﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Graphics
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using UnityEngine.Bindings;
using UnityEngine.Internal;
using UnityEngine.Rendering;

#nullable disable
namespace UnityEngine
{
  /// <summary>
  ///   <para>Raw interface to Unity's drawing functions.</para>
  /// </summary>
  [NativeHeader("Runtime/Graphics/GraphicsScriptBindings.h")]
  [NativeHeader("Runtime/Graphics/CopyTexture.h")]
  [NativeHeader("Runtime/Misc/PlayerSettings.h")]
  [NativeHeader("Runtime/Camera/LightProbeProxyVolume.h")]
  [NativeHeader("Runtime/Shaders/ComputeShader.h")]
  [NativeHeader("Runtime/Graphics/ColorGamut.h")]
  public class Graphics
  {
    internal static readonly int kMaxDrawMeshInstanceCount = Graphics.Internal_GetMaxDrawMeshInstanceCount();
    internal static Dictionary<int, RenderInstancedDataLayout> s_RenderInstancedDataLayouts = new Dictionary<int, RenderInstancedDataLayout>();

    [FreeFunction("GraphicsScripting::GetMaxDrawMeshInstanceCount")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern int Internal_GetMaxDrawMeshInstanceCount();

    [FreeFunction]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern ColorGamut GetActiveColorGamut();

    /// <summary>
    ///   <para>Returns the currently active color gamut.</para>
    /// </summary>
    public static ColorGamut activeColorGamut => Graphics.GetActiveColorGamut();

    /// <summary>
    ///   <para>The GraphicsTier for the current device.</para>
    /// </summary>
    [StaticAccessor("GetGfxDevice()", StaticAccessorType.Dot)]
    public static extern GraphicsTier activeTier { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; }

    [StaticAccessor("GetPlayerSettings()", StaticAccessorType.Dot)]
    [NativeMethod(Name = "GetPreserveFramebufferAlpha")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    internal static extern bool GetPreserveFramebufferAlpha();

    /// <summary>
    ///   <para>True when rendering over native UI is enabled in Player Settings (readonly).</para>
    /// </summary>
    public static bool preserveFramebufferAlpha => Graphics.GetPreserveFramebufferAlpha();

    [NativeMethod(Name = "GetMinOpenGLESVersion")]
    [StaticAccessor("GetPlayerSettings()", StaticAccessorType.Dot)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    internal static extern OpenGLESVersion GetMinOpenGLESVersion();

    /// <summary>
    ///   <para>The minimum OpenGL ES version. The value is specified in PlayerSettings.</para>
    /// </summary>
    public static OpenGLESVersion minOpenGLESVersion => Graphics.GetMinOpenGLESVersion();

    [FreeFunction("GraphicsScripting::GetActiveColorBuffer")]
    private static RenderBuffer GetActiveColorBuffer()
    {
      RenderBuffer ret;
      Graphics.GetActiveColorBuffer_Injected(out ret);
      return ret;
    }

    [FreeFunction("GraphicsScripting::GetActiveDepthBuffer")]
    private static RenderBuffer GetActiveDepthBuffer()
    {
      RenderBuffer ret;
      Graphics.GetActiveDepthBuffer_Injected(out ret);
      return ret;
    }

    [FreeFunction("GraphicsScripting::SetNullRT")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_SetNullRT();

    [NativeMethod(Name = "GraphicsScripting::SetRTSimple", IsFreeFunction = true, ThrowsException = true)]
    private static void Internal_SetRTSimple(
      RenderBuffer color,
      RenderBuffer depth,
      int mip,
      CubemapFace face,
      int depthSlice)
    {
      Graphics.Internal_SetRTSimple_Injected(ref color, ref depth, mip, face, depthSlice);
    }

    [NativeMethod(Name = "GraphicsScripting::SetMRTSimple", IsFreeFunction = true, ThrowsException = true)]
    private static void Internal_SetMRTSimple(
      [NotNull("ArgumentNullException")] RenderBuffer[] color,
      RenderBuffer depth,
      int mip,
      CubemapFace face,
      int depthSlice)
    {
      Graphics.Internal_SetMRTSimple_Injected(color, ref depth, mip, face, depthSlice);
    }

    [NativeMethod(Name = "GraphicsScripting::SetMRTFull", IsFreeFunction = true, ThrowsException = true)]
    private static void Internal_SetMRTFullSetup(
      [NotNull("ArgumentNullException")] RenderBuffer[] color,
      RenderBuffer depth,
      int mip,
      CubemapFace face,
      int depthSlice,
      [NotNull("ArgumentNullException")] RenderBufferLoadAction[] colorLA,
      [NotNull("ArgumentNullException")] RenderBufferStoreAction[] colorSA,
      RenderBufferLoadAction depthLA,
      RenderBufferStoreAction depthSA)
    {
      Graphics.Internal_SetMRTFullSetup_Injected(color, ref depth, mip, face, depthSlice, colorLA, colorSA, depthLA, depthSA);
    }

    [NativeMethod(Name = "GraphicsScripting::SetRandomWriteTargetRT", IsFreeFunction = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_SetRandomWriteTargetRT(int index, RenderTexture uav);

    [FreeFunction("GraphicsScripting::SetRandomWriteTargetBuffer")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_SetRandomWriteTargetBuffer(
      int index,
      ComputeBuffer uav,
      bool preserveCounterValue);

    [FreeFunction("GraphicsScripting::SetRandomWriteTargetBuffer")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_SetRandomWriteTargetGraphicsBuffer(
      int index,
      GraphicsBuffer uav,
      bool preserveCounterValue);

    /// <summary>
    ///   <para>Clear random write targets for level pixel shaders.</para>
    /// </summary>
    [StaticAccessor("GetGfxDevice()", StaticAccessorType.Dot)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern void ClearRandomWriteTargets();

    [FreeFunction("CopyTexture")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void CopyTexture_Full(Texture src, Texture dst);

    [FreeFunction("CopyTexture")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void CopyTexture_Slice_AllMips(
      Texture src,
      int srcElement,
      Texture dst,
      int dstElement);

    [FreeFunction("CopyTexture")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void CopyTexture_Slice(
      Texture src,
      int srcElement,
      int srcMip,
      Texture dst,
      int dstElement,
      int dstMip);

    [FreeFunction("CopyTexture")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void CopyTexture_Region(
      Texture src,
      int srcElement,
      int srcMip,
      int srcX,
      int srcY,
      int srcWidth,
      int srcHeight,
      Texture dst,
      int dstElement,
      int dstMip,
      int dstX,
      int dstY);

    [FreeFunction("ConvertTexture")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern bool ConvertTexture_Full(Texture src, Texture dst);

    [FreeFunction("ConvertTexture")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern bool ConvertTexture_Slice(
      Texture src,
      int srcElement,
      Texture dst,
      int dstElement);

    [FreeFunction("GraphicsScripting::CopyBuffer", ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void CopyBufferImpl([NotNull("ArgumentNullException")] GraphicsBuffer source, [NotNull("ArgumentNullException")] GraphicsBuffer dest);

    [FreeFunction("GraphicsScripting::DrawMeshNow")]
    private static void Internal_DrawMeshNow1(
      [NotNull("NullExceptionObject")] Mesh mesh,
      int subsetIndex,
      Vector3 position,
      Quaternion rotation)
    {
      Graphics.Internal_DrawMeshNow1_Injected(mesh, subsetIndex, ref position, ref rotation);
    }

    [FreeFunction("GraphicsScripting::DrawMeshNow")]
    private static void Internal_DrawMeshNow2([NotNull("NullExceptionObject")] Mesh mesh, int subsetIndex, Matrix4x4 matrix)
    {
      Graphics.Internal_DrawMeshNow2_Injected(mesh, subsetIndex, ref matrix);
    }

    [VisibleToOtherModules(new string[] {"UnityEngine.IMGUIModule"})]
    [FreeFunction("GraphicsScripting::DrawTexture")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    internal static extern void Internal_DrawTexture(ref Internal_DrawTextureArguments args);

    [FreeFunction("GraphicsScripting::RenderMesh")]
    private static unsafe void Internal_RenderMesh(
      RenderParams rparams,
      [NotNull("NullExceptionObject")] Mesh mesh,
      int submeshIndex,
      Matrix4x4 objectToWorld,
      Matrix4x4* prevObjectToWorld)
    {
      Graphics.Internal_RenderMesh_Injected(ref rparams, mesh, submeshIndex, ref objectToWorld, prevObjectToWorld);
    }

    [FreeFunction("GraphicsScripting::RenderMeshInstanced")]
    private static void Internal_RenderMeshInstanced(
      RenderParams rparams,
      [NotNull("NullExceptionObject")] Mesh mesh,
      int submeshIndex,
      IntPtr instanceData,
      RenderInstancedDataLayout layout,
      uint instanceCount)
    {
      Graphics.Internal_RenderMeshInstanced_Injected(ref rparams, mesh, submeshIndex, instanceData, ref layout, instanceCount);
    }

    [FreeFunction("GraphicsScripting::RenderMeshIndirect")]
    private static void Internal_RenderMeshIndirect(
      RenderParams rparams,
      [NotNull("NullExceptionObject")] Mesh mesh,
      [NotNull("NullExceptionObject")] GraphicsBuffer commandBuffer,
      int commandCount,
      int startCommand)
    {
      Graphics.Internal_RenderMeshIndirect_Injected(ref rparams, mesh, commandBuffer, commandCount, startCommand);
    }

    [FreeFunction("GraphicsScripting::RenderMeshPrimitives")]
    private static void Internal_RenderMeshPrimitives(
      RenderParams rparams,
      [NotNull("NullExceptionObject")] Mesh mesh,
      int submeshIndex,
      int instanceCount)
    {
      Graphics.Internal_RenderMeshPrimitives_Injected(ref rparams, mesh, submeshIndex, instanceCount);
    }

    [FreeFunction("GraphicsScripting::RenderPrimitives")]
    private static void Internal_RenderPrimitives(
      RenderParams rparams,
      MeshTopology topology,
      int vertexCount,
      int instanceCount)
    {
      Graphics.Internal_RenderPrimitives_Injected(ref rparams, topology, vertexCount, instanceCount);
    }

    [FreeFunction("GraphicsScripting::RenderPrimitivesIndexed")]
    private static void Internal_RenderPrimitivesIndexed(
      RenderParams rparams,
      MeshTopology topology,
      [NotNull("NullExceptionObject")] GraphicsBuffer indexBuffer,
      int indexCount,
      int startIndex,
      int instanceCount)
    {
      Graphics.Internal_RenderPrimitivesIndexed_Injected(ref rparams, topology, indexBuffer, indexCount, startIndex, instanceCount);
    }

    [FreeFunction("GraphicsScripting::RenderPrimitivesIndirect")]
    private static void Internal_RenderPrimitivesIndirect(
      RenderParams rparams,
      MeshTopology topology,
      [NotNull("NullExceptionObject")] GraphicsBuffer commandBuffer,
      int commandCount,
      int startCommand)
    {
      Graphics.Internal_RenderPrimitivesIndirect_Injected(ref rparams, topology, commandBuffer, commandCount, startCommand);
    }

    [FreeFunction("GraphicsScripting::RenderPrimitivesIndexedIndirect")]
    private static void Internal_RenderPrimitivesIndexedIndirect(
      RenderParams rparams,
      MeshTopology topology,
      [NotNull("NullExceptionObject")] GraphicsBuffer indexBuffer,
      [NotNull("NullExceptionObject")] GraphicsBuffer commandBuffer,
      int commandCount,
      int startCommand)
    {
      Graphics.Internal_RenderPrimitivesIndexedIndirect_Injected(ref rparams, topology, indexBuffer, commandBuffer, commandCount, startCommand);
    }

    [FreeFunction("GraphicsScripting::DrawMesh")]
    private static void Internal_DrawMesh(
      Mesh mesh,
      int submeshIndex,
      Matrix4x4 matrix,
      Material material,
      int layer,
      Camera camera,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      Transform probeAnchor,
      LightProbeUsage lightProbeUsage,
      LightProbeProxyVolume lightProbeProxyVolume)
    {
      Graphics.Internal_DrawMesh_Injected(mesh, submeshIndex, ref matrix, material, layer, camera, properties, castShadows, receiveShadows, probeAnchor, lightProbeUsage, lightProbeProxyVolume);
    }

    [FreeFunction("GraphicsScripting::DrawMeshInstanced")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawMeshInstanced(
      [NotNull("NullExceptionObject")] Mesh mesh,
      int submeshIndex,
      [NotNull("NullExceptionObject")] Material material,
      Matrix4x4[] matrices,
      int count,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer,
      Camera camera,
      LightProbeUsage lightProbeUsage,
      LightProbeProxyVolume lightProbeProxyVolume);

    [FreeFunction("GraphicsScripting::DrawMeshInstancedProcedural")]
    private static void Internal_DrawMeshInstancedProcedural(
      [NotNull("NullExceptionObject")] Mesh mesh,
      int submeshIndex,
      [NotNull("NullExceptionObject")] Material material,
      Bounds bounds,
      int count,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer,
      Camera camera,
      LightProbeUsage lightProbeUsage,
      LightProbeProxyVolume lightProbeProxyVolume)
    {
      Graphics.Internal_DrawMeshInstancedProcedural_Injected(mesh, submeshIndex, material, ref bounds, count, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, lightProbeProxyVolume);
    }

    [FreeFunction("GraphicsScripting::DrawMeshInstancedIndirect")]
    private static void Internal_DrawMeshInstancedIndirect(
      [NotNull("NullExceptionObject")] Mesh mesh,
      int submeshIndex,
      [NotNull("NullExceptionObject")] Material material,
      Bounds bounds,
      ComputeBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer,
      Camera camera,
      LightProbeUsage lightProbeUsage,
      LightProbeProxyVolume lightProbeProxyVolume)
    {
      Graphics.Internal_DrawMeshInstancedIndirect_Injected(mesh, submeshIndex, material, ref bounds, bufferWithArgs, argsOffset, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, lightProbeProxyVolume);
    }

    [FreeFunction("GraphicsScripting::DrawMeshInstancedIndirect")]
    private static void Internal_DrawMeshInstancedIndirectGraphicsBuffer(
      [NotNull("NullExceptionObject")] Mesh mesh,
      int submeshIndex,
      [NotNull("NullExceptionObject")] Material material,
      Bounds bounds,
      GraphicsBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer,
      Camera camera,
      LightProbeUsage lightProbeUsage,
      LightProbeProxyVolume lightProbeProxyVolume)
    {
      Graphics.Internal_DrawMeshInstancedIndirectGraphicsBuffer_Injected(mesh, submeshIndex, material, ref bounds, bufferWithArgs, argsOffset, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, lightProbeProxyVolume);
    }

    [FreeFunction("GraphicsScripting::DrawProceduralNow")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawProceduralNow(
      MeshTopology topology,
      int vertexCount,
      int instanceCount);

    [FreeFunction("GraphicsScripting::DrawProceduralIndexedNow")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawProceduralIndexedNow(
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      int indexCount,
      int instanceCount);

    [FreeFunction("GraphicsScripting::DrawProceduralIndirectNow")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawProceduralIndirectNow(
      MeshTopology topology,
      ComputeBuffer bufferWithArgs,
      int argsOffset);

    [FreeFunction("GraphicsScripting::DrawProceduralIndexedIndirectNow")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawProceduralIndexedIndirectNow(
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      ComputeBuffer bufferWithArgs,
      int argsOffset);

    [FreeFunction("GraphicsScripting::DrawProceduralIndirectNow")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawProceduralIndirectNowGraphicsBuffer(
      MeshTopology topology,
      GraphicsBuffer bufferWithArgs,
      int argsOffset);

    [FreeFunction("GraphicsScripting::DrawProceduralIndexedIndirectNow")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawProceduralIndexedIndirectNowGraphicsBuffer(
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      GraphicsBuffer bufferWithArgs,
      int argsOffset);

    [FreeFunction("GraphicsScripting::DrawProcedural")]
    private static void Internal_DrawProcedural(
      Material material,
      Bounds bounds,
      MeshTopology topology,
      int vertexCount,
      int instanceCount,
      Camera camera,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer)
    {
      Graphics.Internal_DrawProcedural_Injected(material, ref bounds, topology, vertexCount, instanceCount, camera, properties, castShadows, receiveShadows, layer);
    }

    [FreeFunction("GraphicsScripting::DrawProceduralIndexed")]
    private static void Internal_DrawProceduralIndexed(
      Material material,
      Bounds bounds,
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      int indexCount,
      int instanceCount,
      Camera camera,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer)
    {
      Graphics.Internal_DrawProceduralIndexed_Injected(material, ref bounds, topology, indexBuffer, indexCount, instanceCount, camera, properties, castShadows, receiveShadows, layer);
    }

    [FreeFunction("GraphicsScripting::DrawProceduralIndirect")]
    private static void Internal_DrawProceduralIndirect(
      Material material,
      Bounds bounds,
      MeshTopology topology,
      ComputeBuffer bufferWithArgs,
      int argsOffset,
      Camera camera,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer)
    {
      Graphics.Internal_DrawProceduralIndirect_Injected(material, ref bounds, topology, bufferWithArgs, argsOffset, camera, properties, castShadows, receiveShadows, layer);
    }

    [FreeFunction("GraphicsScripting::DrawProceduralIndirect")]
    private static void Internal_DrawProceduralIndirectGraphicsBuffer(
      Material material,
      Bounds bounds,
      MeshTopology topology,
      GraphicsBuffer bufferWithArgs,
      int argsOffset,
      Camera camera,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer)
    {
      Graphics.Internal_DrawProceduralIndirectGraphicsBuffer_Injected(material, ref bounds, topology, bufferWithArgs, argsOffset, camera, properties, castShadows, receiveShadows, layer);
    }

    [FreeFunction("GraphicsScripting::DrawProceduralIndexedIndirect")]
    private static void Internal_DrawProceduralIndexedIndirect(
      Material material,
      Bounds bounds,
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      ComputeBuffer bufferWithArgs,
      int argsOffset,
      Camera camera,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer)
    {
      Graphics.Internal_DrawProceduralIndexedIndirect_Injected(material, ref bounds, topology, indexBuffer, bufferWithArgs, argsOffset, camera, properties, castShadows, receiveShadows, layer);
    }

    [FreeFunction("GraphicsScripting::DrawProceduralIndexedIndirect")]
    private static void Internal_DrawProceduralIndexedIndirectGraphicsBuffer(
      Material material,
      Bounds bounds,
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      GraphicsBuffer bufferWithArgs,
      int argsOffset,
      Camera camera,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer)
    {
      Graphics.Internal_DrawProceduralIndexedIndirectGraphicsBuffer_Injected(material, ref bounds, topology, indexBuffer, bufferWithArgs, argsOffset, camera, properties, castShadows, receiveShadows, layer);
    }

    [FreeFunction("GraphicsScripting::BlitMaterial")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_BlitMaterial5(
      Texture source,
      RenderTexture dest,
      [NotNull("ArgumentNullException")] Material mat,
      int pass,
      bool setRT);

    [FreeFunction("GraphicsScripting::BlitMaterial")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_BlitMaterial6(
      Texture source,
      RenderTexture dest,
      [NotNull("ArgumentNullException")] Material mat,
      int pass,
      bool setRT,
      int destDepthSlice);

    [FreeFunction("GraphicsScripting::BlitMultitap")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_BlitMultiTap4(
      Texture source,
      RenderTexture dest,
      [NotNull("ArgumentNullException")] Material mat,
      [NotNull("ArgumentNullException")] Vector2[] offsets);

    [FreeFunction("GraphicsScripting::BlitMultitap")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_BlitMultiTap5(
      Texture source,
      RenderTexture dest,
      [NotNull("ArgumentNullException")] Material mat,
      [NotNull("ArgumentNullException")] Vector2[] offsets,
      int destDepthSlice);

    [FreeFunction("GraphicsScripting::Blit")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Blit2(Texture source, RenderTexture dest);

    [FreeFunction("GraphicsScripting::Blit")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Blit3(
      Texture source,
      RenderTexture dest,
      int sourceDepthSlice,
      int destDepthSlice);

    [FreeFunction("GraphicsScripting::Blit")]
    private static void Blit4(Texture source, RenderTexture dest, Vector2 scale, Vector2 offset)
    {
      Graphics.Blit4_Injected(source, dest, ref scale, ref offset);
    }

    [FreeFunction("GraphicsScripting::Blit")]
    private static void Blit5(
      Texture source,
      RenderTexture dest,
      Vector2 scale,
      Vector2 offset,
      int sourceDepthSlice,
      int destDepthSlice)
    {
      Graphics.Blit5_Injected(source, dest, ref scale, ref offset, sourceDepthSlice, destDepthSlice);
    }

    [NativeMethod(Name = "GraphicsScripting::CreateGPUFence", IsFreeFunction = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern IntPtr CreateGPUFenceImpl(
      GraphicsFenceType fenceType,
      SynchronisationStageFlags stage);

    [NativeMethod(Name = "GraphicsScripting::WaitOnGPUFence", IsFreeFunction = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void WaitOnGPUFenceImpl(IntPtr fencePtr, SynchronisationStageFlags stage);

    /// <summary>
    ///   <para>Execute a command buffer.</para>
    /// </summary>
    /// <param name="buffer">The buffer to execute.</param>
    [NativeMethod(Name = "GraphicsScripting::ExecuteCommandBuffer", IsFreeFunction = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern void ExecuteCommandBuffer([NotNull("ArgumentNullException")] CommandBuffer buffer);

    /// <summary>
    ///   <para>Executes a command buffer on an async compute queue with the queue selected based on the ComputeQueueType parameter passed.</para>
    /// </summary>
    /// <param name="buffer">The CommandBuffer to be executed.</param>
    /// <param name="queueType">Describes the desired async compute queue the supplied CommandBuffer should be executed on.</param>
    [NativeMethod(Name = "GraphicsScripting::ExecuteCommandBufferAsync", IsFreeFunction = true, ThrowsException = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern void ExecuteCommandBufferAsync(
      [NotNull("ArgumentNullException")] CommandBuffer buffer,
      ComputeQueueType queueType);

    internal static void CheckLoadActionValid(RenderBufferLoadAction load, string bufferType)
    {
      if (load != RenderBufferLoadAction.Load && load != RenderBufferLoadAction.DontCare)
        throw new ArgumentException(UnityString.Format("Bad {0} LoadAction provided.", (object) bufferType));
    }

    internal static void CheckStoreActionValid(RenderBufferStoreAction store, string bufferType)
    {
      if (store != RenderBufferStoreAction.Store && store != RenderBufferStoreAction.DontCare)
        throw new ArgumentException(UnityString.Format("Bad {0} StoreAction provided.", (object) bufferType));
    }

    internal static void SetRenderTargetImpl(RenderTargetSetup setup)
    {
      if (setup.color.Length == 0)
        throw new ArgumentException("Invalid color buffer count for SetRenderTarget");
      if (setup.color.Length != setup.colorLoad.Length)
        throw new ArgumentException("Color LoadAction and Buffer arrays have different sizes");
      if (setup.color.Length != setup.colorStore.Length)
        throw new ArgumentException("Color StoreAction and Buffer arrays have different sizes");
      foreach (RenderBufferLoadAction load in setup.colorLoad)
        Graphics.CheckLoadActionValid(load, "Color");
      foreach (RenderBufferStoreAction store in setup.colorStore)
        Graphics.CheckStoreActionValid(store, "Color");
      Graphics.CheckLoadActionValid(setup.depthLoad, "Depth");
      Graphics.CheckStoreActionValid(setup.depthStore, "Depth");
      if (setup.cubemapFace < CubemapFace.Unknown || setup.cubemapFace > CubemapFace.NegativeZ)
        throw new ArgumentException("Bad CubemapFace provided");
      Graphics.Internal_SetMRTFullSetup(setup.color, setup.depth, setup.mipLevel, setup.cubemapFace, setup.depthSlice, setup.colorLoad, setup.colorStore, setup.depthLoad, setup.depthStore);
    }

    internal static void SetRenderTargetImpl(
      RenderBuffer colorBuffer,
      RenderBuffer depthBuffer,
      int mipLevel,
      CubemapFace face,
      int depthSlice)
    {
      Graphics.Internal_SetRTSimple(colorBuffer, depthBuffer, mipLevel, face, depthSlice);
    }

    internal static void SetRenderTargetImpl(
      RenderTexture rt,
      int mipLevel,
      CubemapFace face,
      int depthSlice)
    {
      if ((bool) (Object) rt)
        Graphics.SetRenderTargetImpl(rt.colorBuffer, rt.depthBuffer, mipLevel, face, depthSlice);
      else
        Graphics.Internal_SetNullRT();
    }

    internal static void SetRenderTargetImpl(
      RenderBuffer[] colorBuffers,
      RenderBuffer depthBuffer,
      int mipLevel,
      CubemapFace face,
      int depthSlice)
    {
      RenderBuffer depth = depthBuffer;
      Graphics.Internal_SetMRTSimple(colorBuffers, depth, mipLevel, face, depthSlice);
    }

    /// <summary>
    ///   <para>Sets current render target.</para>
    /// </summary>
    /// <param name="rt">RenderTexture to set as active render target.</param>
    /// <param name="mipLevel">Mipmap level to render into (use 0 if not mipmapped).</param>
    /// <param name="face">Cubemap face to render into (use Unknown if not a cubemap).</param>
    /// <param name="depthSlice">Depth slice to render into (use 0 if not a 3D or 2DArray render target).</param>
    /// <param name="colorBuffer">Color buffer to render into.</param>
    /// <param name="depthBuffer">Depth buffer to render into.</param>
    /// <param name="colorBuffers">Color buffers to render into (for multiple render target effects).</param>
    /// <param name="setup">Full render target setup information.</param>
    public static void SetRenderTarget(
      RenderTexture rt,
      [UnityEngine.Internal.DefaultValue("0")] int mipLevel,
      [UnityEngine.Internal.DefaultValue("CubemapFace.Unknown")] CubemapFace face,
      [UnityEngine.Internal.DefaultValue("0")] int depthSlice)
    {
      Graphics.SetRenderTargetImpl(rt, mipLevel, face, depthSlice);
    }

    /// <summary>
    ///   <para>Sets current render target.</para>
    /// </summary>
    /// <param name="rt">RenderTexture to set as active render target.</param>
    /// <param name="mipLevel">Mipmap level to render into (use 0 if not mipmapped).</param>
    /// <param name="face">Cubemap face to render into (use Unknown if not a cubemap).</param>
    /// <param name="depthSlice">Depth slice to render into (use 0 if not a 3D or 2DArray render target).</param>
    /// <param name="colorBuffer">Color buffer to render into.</param>
    /// <param name="depthBuffer">Depth buffer to render into.</param>
    /// <param name="colorBuffers">Color buffers to render into (for multiple render target effects).</param>
    /// <param name="setup">Full render target setup information.</param>
    public static void SetRenderTarget(
      RenderBuffer colorBuffer,
      RenderBuffer depthBuffer,
      [UnityEngine.Internal.DefaultValue("0")] int mipLevel,
      [UnityEngine.Internal.DefaultValue("CubemapFace.Unknown")] CubemapFace face,
      [UnityEngine.Internal.DefaultValue("0")] int depthSlice)
    {
      Graphics.SetRenderTargetImpl(colorBuffer, depthBuffer, mipLevel, face, depthSlice);
    }

    /// <summary>
    ///   <para>Sets current render target.</para>
    /// </summary>
    /// <param name="rt">RenderTexture to set as active render target.</param>
    /// <param name="mipLevel">Mipmap level to render into (use 0 if not mipmapped).</param>
    /// <param name="face">Cubemap face to render into (use Unknown if not a cubemap).</param>
    /// <param name="depthSlice">Depth slice to render into (use 0 if not a 3D or 2DArray render target).</param>
    /// <param name="colorBuffer">Color buffer to render into.</param>
    /// <param name="depthBuffer">Depth buffer to render into.</param>
    /// <param name="colorBuffers">Color buffers to render into (for multiple render target effects).</param>
    /// <param name="setup">Full render target setup information.</param>
    public static void SetRenderTarget(RenderBuffer[] colorBuffers, RenderBuffer depthBuffer)
    {
      Graphics.SetRenderTargetImpl(colorBuffers, depthBuffer, 0, CubemapFace.Unknown, 0);
    }

    /// <summary>
    ///   <para>Sets current render target.</para>
    /// </summary>
    /// <param name="rt">RenderTexture to set as active render target.</param>
    /// <param name="mipLevel">Mipmap level to render into (use 0 if not mipmapped).</param>
    /// <param name="face">Cubemap face to render into (use Unknown if not a cubemap).</param>
    /// <param name="depthSlice">Depth slice to render into (use 0 if not a 3D or 2DArray render target).</param>
    /// <param name="colorBuffer">Color buffer to render into.</param>
    /// <param name="depthBuffer">Depth buffer to render into.</param>
    /// <param name="colorBuffers">Color buffers to render into (for multiple render target effects).</param>
    /// <param name="setup">Full render target setup information.</param>
    public static void SetRenderTarget(RenderTargetSetup setup)
    {
      Graphics.SetRenderTargetImpl(setup);
    }

    /// <summary>
    ///   <para>Currently active color buffer (Read Only).</para>
    /// </summary>
    public static RenderBuffer activeColorBuffer => Graphics.GetActiveColorBuffer();

    /// <summary>
    ///   <para>Currently active depth/stencil buffer (Read Only).</para>
    /// </summary>
    public static RenderBuffer activeDepthBuffer => Graphics.GetActiveDepthBuffer();

    /// <summary>
    ///   <para>Set random write target for level pixel shaders.</para>
    /// </summary>
    /// <param name="index">Index of the random write target in the shader.</param>
    /// <param name="uav">Buffer or texture to set as the write target.</param>
    /// <param name="preserveCounterValue">Whether to leave the append/consume counter value unchanged.</param>
    public static void SetRandomWriteTarget(int index, RenderTexture uav)
    {
      if (index < 0 || index >= SystemInfo.supportedRandomWriteTargetCount)
        throw new ArgumentOutOfRangeException(nameof (index), string.Format("must be non-negative less than {0}.", (object) SystemInfo.supportedRandomWriteTargetCount));
      Graphics.Internal_SetRandomWriteTargetRT(index, uav);
    }

    /// <summary>
    ///   <para>Set random write target for level pixel shaders.</para>
    /// </summary>
    /// <param name="index">Index of the random write target in the shader.</param>
    /// <param name="uav">Buffer or texture to set as the write target.</param>
    /// <param name="preserveCounterValue">Whether to leave the append/consume counter value unchanged.</param>
    public static void SetRandomWriteTarget(
      int index,
      ComputeBuffer uav,
      [UnityEngine.Internal.DefaultValue("false")] bool preserveCounterValue)
    {
      if (uav == null)
        throw new ArgumentNullException(nameof (uav));
      if (uav.m_Ptr == IntPtr.Zero)
        throw new ObjectDisposedException(nameof (uav));
      if (index < 0 || index >= SystemInfo.supportedRandomWriteTargetCount)
        throw new ArgumentOutOfRangeException(nameof (index), string.Format("must be non-negative less than {0}.", (object) SystemInfo.supportedRandomWriteTargetCount));
      Graphics.Internal_SetRandomWriteTargetBuffer(index, uav, preserveCounterValue);
    }

    /// <summary>
    ///   <para>Set random write target for level pixel shaders.</para>
    /// </summary>
    /// <param name="index">Index of the random write target in the shader.</param>
    /// <param name="uav">Buffer or texture to set as the write target.</param>
    /// <param name="preserveCounterValue">Whether to leave the append/consume counter value unchanged.</param>
    public static void SetRandomWriteTarget(
      int index,
      GraphicsBuffer uav,
      [UnityEngine.Internal.DefaultValue("false")] bool preserveCounterValue)
    {
      if (uav == null)
        throw new ArgumentNullException(nameof (uav));
      if (uav.m_Ptr == IntPtr.Zero)
        throw new ObjectDisposedException(nameof (uav));
      if (index < 0 || index >= SystemInfo.supportedRandomWriteTargetCount)
        throw new ArgumentOutOfRangeException(nameof (index), string.Format("must be non-negative less than {0}.", (object) SystemInfo.supportedRandomWriteTargetCount));
      Graphics.Internal_SetRandomWriteTargetGraphicsBuffer(index, uav, preserveCounterValue);
    }

    /// <summary>
    ///   <para>Copies pixel data from one texture to another.</para>
    /// </summary>
    /// <param name="src">The source texture.</param>
    /// <param name="dst">The destination texture.</param>
    /// <param name="srcElement">The element in the source texture to copy from. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if src is a 2D texture.</param>
    /// <param name="srcMip">The mipmap level to copy from. The range is 0 through the texture's Texture.mipmapCount. The default value is 0.</param>
    /// <param name="dstElement">The element in the source texture to copy to. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if `dst` is a 2D texture.</param>
    /// <param name="dstMip">The mipmap level to write to. The range is 0 through the texture's Texture.mipmapCount. The default value is 0.</param>
    /// <param name="srcX">The starting x coordinate of src to copy from. 0 is the left of the texture.</param>
    /// <param name="srcY">The starting y coordinate of src to copy from. 0 is the bottom of the texture.</param>
    /// <param name="srcWidth">The width of src to copy.</param>
    /// <param name="srcHeight">The height of src to copy.</param>
    /// <param name="dstX">The x coordinate of dst to copy to.</param>
    /// <param name="dstY">The y coordinate to dst to copy to.</param>
    public static void CopyTexture(Texture src, Texture dst) => Graphics.CopyTexture_Full(src, dst);

    public static void CopyTexture(Texture src, int srcElement, Texture dst, int dstElement)
    {
      Graphics.CopyTexture_Slice_AllMips(src, srcElement, dst, dstElement);
    }

    /// <summary>
    ///   <para>Copies pixel data from one texture to another.</para>
    /// </summary>
    /// <param name="src">The source texture.</param>
    /// <param name="dst">The destination texture.</param>
    /// <param name="srcElement">The element in the source texture to copy from. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if src is a 2D texture.</param>
    /// <param name="srcMip">The mipmap level to copy from. The range is 0 through the texture's Texture.mipmapCount. The default value is 0.</param>
    /// <param name="dstElement">The element in the source texture to copy to. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if `dst` is a 2D texture.</param>
    /// <param name="dstMip">The mipmap level to write to. The range is 0 through the texture's Texture.mipmapCount. The default value is 0.</param>
    /// <param name="srcX">The starting x coordinate of src to copy from. 0 is the left of the texture.</param>
    /// <param name="srcY">The starting y coordinate of src to copy from. 0 is the bottom of the texture.</param>
    /// <param name="srcWidth">The width of src to copy.</param>
    /// <param name="srcHeight">The height of src to copy.</param>
    /// <param name="dstX">The x coordinate of dst to copy to.</param>
    /// <param name="dstY">The y coordinate to dst to copy to.</param>
    public static void CopyTexture(
      Texture src,
      int srcElement,
      int srcMip,
      Texture dst,
      int dstElement,
      int dstMip)
    {
      Graphics.CopyTexture_Slice(src, srcElement, srcMip, dst, dstElement, dstMip);
    }

    /// <summary>
    ///   <para>Copies pixel data from one texture to another.</para>
    /// </summary>
    /// <param name="src">The source texture.</param>
    /// <param name="dst">The destination texture.</param>
    /// <param name="srcElement">The element in the source texture to copy from. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if src is a 2D texture.</param>
    /// <param name="srcMip">The mipmap level to copy from. The range is 0 through the texture's Texture.mipmapCount. The default value is 0.</param>
    /// <param name="dstElement">The element in the source texture to copy to. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if `dst` is a 2D texture.</param>
    /// <param name="dstMip">The mipmap level to write to. The range is 0 through the texture's Texture.mipmapCount. The default value is 0.</param>
    /// <param name="srcX">The starting x coordinate of src to copy from. 0 is the left of the texture.</param>
    /// <param name="srcY">The starting y coordinate of src to copy from. 0 is the bottom of the texture.</param>
    /// <param name="srcWidth">The width of src to copy.</param>
    /// <param name="srcHeight">The height of src to copy.</param>
    /// <param name="dstX">The x coordinate of dst to copy to.</param>
    /// <param name="dstY">The y coordinate to dst to copy to.</param>
    public static void CopyTexture(
      Texture src,
      int srcElement,
      int srcMip,
      int srcX,
      int srcY,
      int srcWidth,
      int srcHeight,
      Texture dst,
      int dstElement,
      int dstMip,
      int dstX,
      int dstY)
    {
      Graphics.CopyTexture_Region(src, srcElement, srcMip, srcX, srcY, srcWidth, srcHeight, dst, dstElement, dstMip, dstX, dstY);
    }

    /// <summary>
    ///   <para>Copies the pixel data from one texture, converts the data into a different format, and copies it into another texture.</para>
    /// </summary>
    /// <param name="src">The source texture. The texture must be a Texture2D or Cubemap.</param>
    /// <param name="dst">The destination texture. The texture must be a Texture2D, Texture2DArray, Cubemap, or CubemapArray. The texture must also be uncompressed and correspond to a supported RenderTextureFormat.</param>
    /// <param name="srcElement">The element in the source texture to copy from. Use CubemapFace if src is a Cubemap. Set the value to 0 if src is a 2D texture.</param>
    /// <param name="dstElement">The element in the source texture to copy to. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if `dst` is a 2D texture.</param>
    /// <returns>
    ///   <para>true if the method succeeded.</para>
    /// </returns>
    public static bool ConvertTexture(Texture src, Texture dst)
    {
      return Graphics.ConvertTexture_Full(src, dst);
    }

    /// <summary>
    ///   <para>Copies the pixel data from one texture, converts the data into a different format, and copies it into another texture.</para>
    /// </summary>
    /// <param name="src">The source texture. The texture must be a Texture2D or Cubemap.</param>
    /// <param name="dst">The destination texture. The texture must be a Texture2D, Texture2DArray, Cubemap, or CubemapArray. The texture must also be uncompressed and correspond to a supported RenderTextureFormat.</param>
    /// <param name="srcElement">The element in the source texture to copy from. Use CubemapFace if src is a Cubemap. Set the value to 0 if src is a 2D texture.</param>
    /// <param name="dstElement">The element in the source texture to copy to. For example, the CubemapFace in a Cubemap or the slice in a texture array. Set the value to 0 if `dst` is a 2D texture.</param>
    /// <returns>
    ///   <para>true if the method succeeded.</para>
    /// </returns>
    public static bool ConvertTexture(Texture src, int srcElement, Texture dst, int dstElement)
    {
      return Graphics.ConvertTexture_Slice(src, srcElement, dst, dstElement);
    }

    /// <summary>
    ///   <para>Shortcut for calling Graphics.CreateGraphicsFence with Rendering.GraphicsFenceType.AsyncQueueSynchronisation as the first parameter.</para>
    /// </summary>
    /// <param name="stage">Which SynchronisationStage to insert the fence after.</param>
    /// <returns>
    ///   <para>Returns a new GraphicsFence.</para>
    /// </returns>
    public static GraphicsFence CreateAsyncGraphicsFence([UnityEngine.Internal.DefaultValue("SynchronisationStage.PixelProcessing")] SynchronisationStage stage)
    {
      return Graphics.CreateGraphicsFence(GraphicsFenceType.AsyncQueueSynchronisation, GraphicsFence.TranslateSynchronizationStageToFlags(stage));
    }

    /// <summary>
    ///   <para>Shortcut for calling Graphics.CreateGraphicsFence with Rendering.GraphicsFenceType.AsyncQueueSynchronisation as the first parameter.</para>
    /// </summary>
    /// <param name="stage">Which SynchronisationStage to insert the fence after.</param>
    /// <returns>
    ///   <para>Returns a new GraphicsFence.</para>
    /// </returns>
    public static GraphicsFence CreateAsyncGraphicsFence()
    {
      return Graphics.CreateGraphicsFence(GraphicsFenceType.AsyncQueueSynchronisation, SynchronisationStageFlags.PixelProcessing);
    }

    /// <summary>
    ///   <para>Creates a GraphicsFence.</para>
    /// </summary>
    /// <param name="fenceType">The Rendering.GraphicsFenceType to create. Currently the only supported value is Rendering.GraphicsFenceType.AsyncQueueSynchronisation.</param>
    /// <param name="stage">Which SynchronisationStage to insert the fence after.</param>
    /// <returns>
    ///   <para>Returns a new GraphicsFence.</para>
    /// </returns>
    public static GraphicsFence CreateGraphicsFence(
      GraphicsFenceType fenceType,
      [UnityEngine.Internal.DefaultValue("SynchronisationStage.PixelProcessing")] SynchronisationStageFlags stage)
    {
      GraphicsFence graphicsFence = new GraphicsFence();
      graphicsFence.m_FenceType = fenceType;
      graphicsFence.m_Ptr = Graphics.CreateGPUFenceImpl(fenceType, stage);
      graphicsFence.InitPostAllocation();
      graphicsFence.Validate();
      return graphicsFence;
    }

    /// <summary>
    ///   <para>Instructs the GPU to pause processing of the queue until it passes through the GraphicsFence fence.</para>
    /// </summary>
    /// <param name="fence">The GraphicsFence the GPU waits for. The fenceType of the graphics fence must be Rendering.GraphicsFenceType.AsyncQueueSynchronisation.</param>
    /// <param name="stage">Which SynchronisationStage to wait for.</param>
    public static void WaitOnAsyncGraphicsFence(GraphicsFence fence)
    {
      Graphics.WaitOnAsyncGraphicsFence(fence, SynchronisationStage.PixelProcessing);
    }

    /// <summary>
    ///   <para>Instructs the GPU to pause processing of the queue until it passes through the GraphicsFence fence.</para>
    /// </summary>
    /// <param name="fence">The GraphicsFence the GPU waits for. The fenceType of the graphics fence must be Rendering.GraphicsFenceType.AsyncQueueSynchronisation.</param>
    /// <param name="stage">Which SynchronisationStage to wait for.</param>
    public static void WaitOnAsyncGraphicsFence(GraphicsFence fence, [UnityEngine.Internal.DefaultValue("SynchronisationStage.PixelProcessing")] SynchronisationStage stage)
    {
      if (fence.m_FenceType != 0)
        throw new ArgumentException("Graphics.WaitOnGraphicsFence can only be called with fences created with GraphicsFenceType.AsyncQueueSynchronization.");
      fence.Validate();
      if (!fence.IsFencePending())
        return;
      Graphics.WaitOnGPUFenceImpl(fence.m_Ptr, GraphicsFence.TranslateSynchronizationStageToFlags(stage));
    }

    internal static void ValidateCopyBuffer(GraphicsBuffer source, GraphicsBuffer dest)
    {
      if (source == null)
        throw new ArgumentNullException(nameof (source));
      if (dest == null)
        throw new ArgumentNullException(nameof (dest));
      long num1 = (long) source.count * (long) source.stride;
      long num2 = (long) dest.count * (long) dest.stride;
      if (num1 != num2)
        throw new ArgumentException(string.Format("CopyBuffer source and destination buffers must be the same size, source was {0} bytes, dest was {1} bytes", (object) num1, (object) num2));
      if ((source.target & GraphicsBuffer.Target.CopySource) == (GraphicsBuffer.Target) 0)
        throw new ArgumentException("CopyBuffer source must have CopySource target", nameof (source));
      if ((dest.target & GraphicsBuffer.Target.CopyDestination) == (GraphicsBuffer.Target) 0)
        throw new ArgumentException("CopyBuffer destination must have CopyDestination target", nameof (dest));
    }

    /// <summary>
    ///   <para>Copies the contents of one GraphicsBuffer into another.</para>
    /// </summary>
    /// <param name="source">The source buffer.</param>
    /// <param name="dest">The destination buffer.</param>
    public static void CopyBuffer(GraphicsBuffer source, GraphicsBuffer dest)
    {
      Graphics.ValidateCopyBuffer(source, dest);
      Graphics.CopyBufferImpl(source, dest);
    }

    private static void DrawTextureImpl(
      Rect screenRect,
      Texture texture,
      Rect sourceRect,
      int leftBorder,
      int rightBorder,
      int topBorder,
      int bottomBorder,
      Color color,
      Material mat,
      int pass)
    {
      Graphics.Internal_DrawTexture(ref new Internal_DrawTextureArguments()
      {
        screenRect = screenRect,
        sourceRect = sourceRect,
        leftBorder = leftBorder,
        rightBorder = rightBorder,
        topBorder = topBorder,
        bottomBorder = bottomBorder,
        color = color,
        leftBorderColor = Color.black,
        topBorderColor = Color.black,
        rightBorderColor = Color.black,
        bottomBorderColor = Color.black,
        pass = pass,
        texture = texture,
        smoothCorners = true,
        mat = mat
      });
    }

    /// <summary>
    ///   <para>Draw a texture in screen coordinates.</para>
    /// </summary>
    /// <param name="screenRect">Rectangle on the screen to use for the texture. In pixel coordinates with (0,0) in the upper-left corner.</param>
    /// <param name="texture">Texture to draw.</param>
    /// <param name="sourceRect">Region of the texture to use. In normalized coordinates with (0,0) in the bottom-left corner.</param>
    /// <param name="leftBorder">Number of pixels from the left that are not affected by scale.</param>
    /// <param name="rightBorder">Number of pixels from the right that are not affected by scale.</param>
    /// <param name="topBorder">Number of pixels from the top that are not affected by scale.</param>
    /// <param name="bottomBorder">Number of pixels from the bottom that are not affected by scale.</param>
    /// <param name="color">Color that modulates the output. The neutral value is (0.5, 0.5, 0.5, 0.5). Set as vertex color for the shader.</param>
    /// <param name="mat">Custom Material that can be used to draw the texture. If null is passed, a default material with the Internal-GUITexture.shader is used.</param>
    /// <param name="pass">If -1 (default), draws all passes in the material. Otherwise, draws given pass only.</param>
    public static void DrawTexture(
      Rect screenRect,
      Texture texture,
      Rect sourceRect,
      int leftBorder,
      int rightBorder,
      int topBorder,
      int bottomBorder,
      Color color,
      [UnityEngine.Internal.DefaultValue("null")] Material mat,
      [UnityEngine.Internal.DefaultValue("-1")] int pass)
    {
      Graphics.DrawTextureImpl(screenRect, texture, sourceRect, leftBorder, rightBorder, topBorder, bottomBorder, color, mat, pass);
    }

    /// <summary>
    ///   <para>Draw a texture in screen coordinates.</para>
    /// </summary>
    /// <param name="screenRect">Rectangle on the screen to use for the texture. In pixel coordinates with (0,0) in the upper-left corner.</param>
    /// <param name="texture">Texture to draw.</param>
    /// <param name="sourceRect">Region of the texture to use. In normalized coordinates with (0,0) in the bottom-left corner.</param>
    /// <param name="leftBorder">Number of pixels from the left that are not affected by scale.</param>
    /// <param name="rightBorder">Number of pixels from the right that are not affected by scale.</param>
    /// <param name="topBorder">Number of pixels from the top that are not affected by scale.</param>
    /// <param name="bottomBorder">Number of pixels from the bottom that are not affected by scale.</param>
    /// <param name="color">Color that modulates the output. The neutral value is (0.5, 0.5, 0.5, 0.5). Set as vertex color for the shader.</param>
    /// <param name="mat">Custom Material that can be used to draw the texture. If null is passed, a default material with the Internal-GUITexture.shader is used.</param>
    /// <param name="pass">If -1 (default), draws all passes in the material. Otherwise, draws given pass only.</param>
    public static void DrawTexture(
      Rect screenRect,
      Texture texture,
      Rect sourceRect,
      int leftBorder,
      int rightBorder,
      int topBorder,
      int bottomBorder,
      [UnityEngine.Internal.DefaultValue("null")] Material mat,
      [UnityEngine.Internal.DefaultValue("-1")] int pass)
    {
      Color32 color32 = new Color32((byte) 128, (byte) 128, (byte) 128, (byte) 128);
      Graphics.DrawTextureImpl(screenRect, texture, sourceRect, leftBorder, rightBorder, topBorder, bottomBorder, (Color) color32, mat, pass);
    }

    /// <summary>
    ///   <para>Draw a texture in screen coordinates.</para>
    /// </summary>
    /// <param name="screenRect">Rectangle on the screen to use for the texture. In pixel coordinates with (0,0) in the upper-left corner.</param>
    /// <param name="texture">Texture to draw.</param>
    /// <param name="sourceRect">Region of the texture to use. In normalized coordinates with (0,0) in the bottom-left corner.</param>
    /// <param name="leftBorder">Number of pixels from the left that are not affected by scale.</param>
    /// <param name="rightBorder">Number of pixels from the right that are not affected by scale.</param>
    /// <param name="topBorder">Number of pixels from the top that are not affected by scale.</param>
    /// <param name="bottomBorder">Number of pixels from the bottom that are not affected by scale.</param>
    /// <param name="color">Color that modulates the output. The neutral value is (0.5, 0.5, 0.5, 0.5). Set as vertex color for the shader.</param>
    /// <param name="mat">Custom Material that can be used to draw the texture. If null is passed, a default material with the Internal-GUITexture.shader is used.</param>
    /// <param name="pass">If -1 (default), draws all passes in the material. Otherwise, draws given pass only.</param>
    public static void DrawTexture(
      Rect screenRect,
      Texture texture,
      int leftBorder,
      int rightBorder,
      int topBorder,
      int bottomBorder,
      [UnityEngine.Internal.DefaultValue("null")] Material mat,
      [UnityEngine.Internal.DefaultValue("-1")] int pass)
    {
      Graphics.DrawTexture(screenRect, texture, new Rect(0.0f, 0.0f, 1f, 1f), leftBorder, rightBorder, topBorder, bottomBorder, mat, pass);
    }

    /// <summary>
    ///   <para>Draw a texture in screen coordinates.</para>
    /// </summary>
    /// <param name="screenRect">Rectangle on the screen to use for the texture. In pixel coordinates with (0,0) in the upper-left corner.</param>
    /// <param name="texture">Texture to draw.</param>
    /// <param name="sourceRect">Region of the texture to use. In normalized coordinates with (0,0) in the bottom-left corner.</param>
    /// <param name="leftBorder">Number of pixels from the left that are not affected by scale.</param>
    /// <param name="rightBorder">Number of pixels from the right that are not affected by scale.</param>
    /// <param name="topBorder">Number of pixels from the top that are not affected by scale.</param>
    /// <param name="bottomBorder">Number of pixels from the bottom that are not affected by scale.</param>
    /// <param name="color">Color that modulates the output. The neutral value is (0.5, 0.5, 0.5, 0.5). Set as vertex color for the shader.</param>
    /// <param name="mat">Custom Material that can be used to draw the texture. If null is passed, a default material with the Internal-GUITexture.shader is used.</param>
    /// <param name="pass">If -1 (default), draws all passes in the material. Otherwise, draws given pass only.</param>
    public static void DrawTexture(Rect screenRect, Texture texture, [UnityEngine.Internal.DefaultValue("null")] Material mat, [UnityEngine.Internal.DefaultValue("-1")] int pass)
    {
      Graphics.DrawTexture(screenRect, texture, 0, 0, 0, 0, mat, pass);
    }

    public static unsafe void RenderMesh(
      in RenderParams rparams,
      Mesh mesh,
      int submeshIndex,
      Matrix4x4 objectToWorld,
      [UnityEngine.Internal.DefaultValue("null")] Matrix4x4? prevObjectToWorld = null)
    {
      if (prevObjectToWorld.HasValue)
      {
        Matrix4x4 matrix4x4 = prevObjectToWorld.Value;
        Graphics.Internal_RenderMesh(rparams, mesh, submeshIndex, objectToWorld, &matrix4x4);
      }
      else
        Graphics.Internal_RenderMesh(rparams, mesh, submeshIndex, objectToWorld, (Matrix4x4*) null);
    }

    private static RenderInstancedDataLayout GetCachedRenderInstancedDataLayout(System.Type type)
    {
      int hashCode = type.GetHashCode();
      RenderInstancedDataLayout instancedDataLayout;
      if (!Graphics.s_RenderInstancedDataLayouts.TryGetValue(hashCode, out instancedDataLayout))
      {
        instancedDataLayout = new RenderInstancedDataLayout(type);
        Graphics.s_RenderInstancedDataLayouts.Add(hashCode, instancedDataLayout);
      }
      return instancedDataLayout;
    }

    public static unsafe void RenderMeshInstanced<T>(
      in RenderParams rparams,
      Mesh mesh,
      int submeshIndex,
      T[] instanceData,
      [UnityEngine.Internal.DefaultValue("-1")] int instanceCount = -1,
      [UnityEngine.Internal.DefaultValue("0")] int startInstance = 0)
      where T : unmanaged
    {
      if (!SystemInfo.supportsInstancing)
        throw new InvalidOperationException("Instancing is not supported.");
      if (!rparams.material.enableInstancing)
        throw new InvalidOperationException("Material needs to enable instancing for use with RenderMeshInstanced.");
      if (instanceData == null)
        throw new ArgumentNullException(nameof (instanceData));
      RenderInstancedDataLayout instancedDataLayout = Graphics.GetCachedRenderInstancedDataLayout(typeof (T));
      uint instanceCount1 = Math.Min((uint) instanceCount, (uint) Math.Max(0, instanceData.Length - startInstance));
      fixed (T* objPtr = instanceData)
        Graphics.Internal_RenderMeshInstanced(rparams, mesh, submeshIndex, (IntPtr) (void*) (objPtr + startInstance), instancedDataLayout, instanceCount1);
    }

    public static unsafe void RenderMeshInstanced<T>(
      in RenderParams rparams,
      Mesh mesh,
      int submeshIndex,
      List<T> instanceData,
      [UnityEngine.Internal.DefaultValue("-1")] int instanceCount = -1,
      [UnityEngine.Internal.DefaultValue("0")] int startInstance = 0)
      where T : unmanaged
    {
      if (!SystemInfo.supportsInstancing)
        throw new InvalidOperationException("Instancing is not supported.");
      if (!rparams.material.enableInstancing)
        throw new InvalidOperationException("Material needs to enable instancing for use with RenderMeshInstanced.");
      if (instanceData == null)
        throw new ArgumentNullException(nameof (instanceData));
      RenderInstancedDataLayout instancedDataLayout = Graphics.GetCachedRenderInstancedDataLayout(typeof (T));
      uint instanceCount1 = Math.Min((uint) instanceCount, (uint) Math.Max(0, instanceData.Count - startInstance));
      fixed (T* objPtr = NoAllocHelpers.ExtractArrayFromListT<T>(instanceData))
        Graphics.Internal_RenderMeshInstanced(rparams, mesh, submeshIndex, (IntPtr) (void*) (objPtr + startInstance), instancedDataLayout, instanceCount1);
    }

    public static unsafe void RenderMeshInstanced<T>(
      RenderParams rparams,
      Mesh mesh,
      int submeshIndex,
      NativeArray<T> instanceData,
      [UnityEngine.Internal.DefaultValue("-1")] int instanceCount = -1,
      [UnityEngine.Internal.DefaultValue("0")] int startInstance = 0)
      where T : unmanaged
    {
      if (!SystemInfo.supportsInstancing)
        throw new InvalidOperationException("Instancing is not supported.");
      if (!rparams.material.enableInstancing)
        throw new InvalidOperationException("Material needs to enable instancing for use with RenderMeshInstanced.");
      RenderInstancedDataLayout instancedDataLayout = Graphics.GetCachedRenderInstancedDataLayout(typeof (T));
      uint instanceCount1 = Math.Min((uint) instanceCount, (uint) Math.Max(0, instanceData.Length - startInstance));
      Graphics.Internal_RenderMeshInstanced(rparams, mesh, submeshIndex, (IntPtr) (void*) ((T*) instanceData.GetUnsafePtr<T>() + startInstance), instancedDataLayout, instanceCount1);
    }

    public static void RenderMeshIndirect(
      in RenderParams rparams,
      Mesh mesh,
      GraphicsBuffer commandBuffer,
      [UnityEngine.Internal.DefaultValue("1")] int commandCount = 1,
      [UnityEngine.Internal.DefaultValue("0")] int startCommand = 0)
    {
      if (!SystemInfo.supportsInstancing)
        throw new InvalidOperationException("Instancing is not supported.");
      Graphics.Internal_RenderMeshIndirect(rparams, mesh, commandBuffer, commandCount, startCommand);
    }

    public static void RenderMeshPrimitives(
      in RenderParams rparams,
      Mesh mesh,
      int submeshIndex,
      [UnityEngine.Internal.DefaultValue("1")] int instanceCount = 1)
    {
      if (!SystemInfo.supportsInstancing)
        throw new InvalidOperationException("Instancing is not supported.");
      Graphics.Internal_RenderMeshPrimitives(rparams, mesh, submeshIndex, instanceCount);
    }

    public static void RenderPrimitives(
      in RenderParams rparams,
      MeshTopology topology,
      int vertexCount,
      [UnityEngine.Internal.DefaultValue("1")] int instanceCount = 1)
    {
      if (!SystemInfo.supportsInstancing)
        throw new InvalidOperationException("Instancing is not supported.");
      Graphics.Internal_RenderPrimitives(rparams, topology, vertexCount, instanceCount);
    }

    public static void RenderPrimitivesIndexed(
      in RenderParams rparams,
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      int indexCount,
      [UnityEngine.Internal.DefaultValue("0")] int startIndex = 0,
      [UnityEngine.Internal.DefaultValue("1")] int instanceCount = 1)
    {
      if (!SystemInfo.supportsInstancing)
        throw new InvalidOperationException("Instancing is not supported.");
      Graphics.Internal_RenderPrimitivesIndexed(rparams, topology, indexBuffer, indexCount, startIndex, instanceCount);
    }

    public static void RenderPrimitivesIndirect(
      in RenderParams rparams,
      MeshTopology topology,
      GraphicsBuffer commandBuffer,
      [UnityEngine.Internal.DefaultValue("1")] int commandCount = 1,
      [UnityEngine.Internal.DefaultValue("0")] int startCommand = 0)
    {
      if (!SystemInfo.supportsInstancing)
        throw new InvalidOperationException("Instancing is not supported.");
      Graphics.Internal_RenderPrimitivesIndirect(rparams, topology, commandBuffer, commandCount, startCommand);
    }

    public static void RenderPrimitivesIndexedIndirect(
      in RenderParams rparams,
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      GraphicsBuffer commandBuffer,
      [UnityEngine.Internal.DefaultValue("1")] int commandCount = 1,
      [UnityEngine.Internal.DefaultValue("0")] int startCommand = 0)
    {
      if (!SystemInfo.supportsInstancing)
        throw new InvalidOperationException("Instancing is not supported.");
      Graphics.Internal_RenderPrimitivesIndexedIndirect(rparams, topology, indexBuffer, commandBuffer, commandCount, startCommand);
    }

    /// <summary>
    ///   <para>Draw a mesh immediately.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="position">Position of the mesh.</param>
    /// <param name="rotation">Rotation of the mesh.</param>
    /// <param name="matrix">The transformation matrix of the mesh (combines position, rotation and other transformations).</param>
    /// <param name="materialIndex">Subset of the mesh to draw.</param>
    public static void DrawMeshNow(
      Mesh mesh,
      Vector3 position,
      Quaternion rotation,
      int materialIndex)
    {
      if ((Object) mesh == (Object) null)
        throw new ArgumentNullException(nameof (mesh));
      Graphics.Internal_DrawMeshNow1(mesh, materialIndex, position, rotation);
    }

    /// <summary>
    ///   <para>Draw a mesh immediately.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="position">Position of the mesh.</param>
    /// <param name="rotation">Rotation of the mesh.</param>
    /// <param name="matrix">The transformation matrix of the mesh (combines position, rotation and other transformations).</param>
    /// <param name="materialIndex">Subset of the mesh to draw.</param>
    public static void DrawMeshNow(Mesh mesh, Matrix4x4 matrix, int materialIndex)
    {
      if ((Object) mesh == (Object) null)
        throw new ArgumentNullException(nameof (mesh));
      Graphics.Internal_DrawMeshNow2(mesh, materialIndex, matrix);
    }

    /// <summary>
    ///   <para>Draw a mesh immediately.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="position">Position of the mesh.</param>
    /// <param name="rotation">Rotation of the mesh.</param>
    /// <param name="matrix">The transformation matrix of the mesh (combines position, rotation and other transformations).</param>
    /// <param name="materialIndex">Subset of the mesh to draw.</param>
    public static void DrawMeshNow(Mesh mesh, Vector3 position, Quaternion rotation)
    {
      Graphics.DrawMeshNow(mesh, position, rotation, -1);
    }

    /// <summary>
    ///   <para>Draw a mesh immediately.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="position">Position of the mesh.</param>
    /// <param name="rotation">Rotation of the mesh.</param>
    /// <param name="matrix">The transformation matrix of the mesh (combines position, rotation and other transformations).</param>
    /// <param name="materialIndex">Subset of the mesh to draw.</param>
    public static void DrawMeshNow(Mesh mesh, Matrix4x4 matrix)
    {
      Graphics.DrawMeshNow(mesh, matrix, -1);
    }

    /// <summary>
    ///   <para>Draw a mesh.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="position">Position of the mesh.</param>
    /// <param name="rotation">Rotation of the mesh.</param>
    /// <param name="matrix">Transformation matrix of the mesh (combines position, rotation and other transformations).</param>
    /// <param name="material">Material to use.</param>
    /// <param name="layer"> the mesh is drawn on.</param>
    /// <param name="camera">If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This applies only to meshes that are composed of several materials.</param>
    /// <param name="properties">Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock.</param>
    /// <param name="castShadows">Determines whether the mesh can cast shadows.</param>
    /// <param name="receiveShadows">Determines whether the mesh can receive shadows.</param>
    /// <param name="useLightProbes">Should the mesh use light probes?</param>
    /// <param name="probeAnchor">If used, the mesh will use this Transform's position to sample light probes and find the matching reflection probe.</param>
    /// <param name="lightProbeUsage">LightProbeUsage for the mesh.</param>
    /// <param name="lightProbeProxyVolume"></param>
    public static void DrawMesh(
      Mesh mesh,
      Vector3 position,
      Quaternion rotation,
      Material material,
      int layer,
      [UnityEngine.Internal.DefaultValue("null")] Camera camera,
      [UnityEngine.Internal.DefaultValue("0")] int submeshIndex,
      [UnityEngine.Internal.DefaultValue("null")] MaterialPropertyBlock properties,
      [UnityEngine.Internal.DefaultValue("true")] bool castShadows,
      [UnityEngine.Internal.DefaultValue("true")] bool receiveShadows,
      [UnityEngine.Internal.DefaultValue("true")] bool useLightProbes)
    {
      Graphics.DrawMesh(mesh, Matrix4x4.TRS(position, rotation, Vector3.one), material, layer, camera, submeshIndex, properties, castShadows ? ShadowCastingMode.On : ShadowCastingMode.Off, receiveShadows, (Transform) null, useLightProbes ? LightProbeUsage.BlendProbes : LightProbeUsage.Off, (LightProbeProxyVolume) null);
    }

    /// <summary>
    ///   <para>Draw a mesh.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="position">Position of the mesh.</param>
    /// <param name="rotation">Rotation of the mesh.</param>
    /// <param name="matrix">Transformation matrix of the mesh (combines position, rotation and other transformations).</param>
    /// <param name="material">Material to use.</param>
    /// <param name="layer"> the mesh is drawn on.</param>
    /// <param name="camera">If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This applies only to meshes that are composed of several materials.</param>
    /// <param name="properties">Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock.</param>
    /// <param name="castShadows">Determines whether the mesh can cast shadows.</param>
    /// <param name="receiveShadows">Determines whether the mesh can receive shadows.</param>
    /// <param name="useLightProbes">Should the mesh use light probes?</param>
    /// <param name="probeAnchor">If used, the mesh will use this Transform's position to sample light probes and find the matching reflection probe.</param>
    /// <param name="lightProbeUsage">LightProbeUsage for the mesh.</param>
    /// <param name="lightProbeProxyVolume"></param>
    public static void DrawMesh(
      Mesh mesh,
      Vector3 position,
      Quaternion rotation,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      [UnityEngine.Internal.DefaultValue("true")] bool receiveShadows,
      [UnityEngine.Internal.DefaultValue("null")] Transform probeAnchor,
      [UnityEngine.Internal.DefaultValue("true")] bool useLightProbes)
    {
      Graphics.DrawMesh(mesh, Matrix4x4.TRS(position, rotation, Vector3.one), material, layer, camera, submeshIndex, properties, castShadows, receiveShadows, probeAnchor, useLightProbes ? LightProbeUsage.BlendProbes : LightProbeUsage.Off, (LightProbeProxyVolume) null);
    }

    /// <summary>
    ///   <para>Draw a mesh.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="position">Position of the mesh.</param>
    /// <param name="rotation">Rotation of the mesh.</param>
    /// <param name="matrix">Transformation matrix of the mesh (combines position, rotation and other transformations).</param>
    /// <param name="material">Material to use.</param>
    /// <param name="layer"> the mesh is drawn on.</param>
    /// <param name="camera">If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This applies only to meshes that are composed of several materials.</param>
    /// <param name="properties">Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock.</param>
    /// <param name="castShadows">Determines whether the mesh can cast shadows.</param>
    /// <param name="receiveShadows">Determines whether the mesh can receive shadows.</param>
    /// <param name="useLightProbes">Should the mesh use light probes?</param>
    /// <param name="probeAnchor">If used, the mesh will use this Transform's position to sample light probes and find the matching reflection probe.</param>
    /// <param name="lightProbeUsage">LightProbeUsage for the mesh.</param>
    /// <param name="lightProbeProxyVolume"></param>
    public static void DrawMesh(
      Mesh mesh,
      Matrix4x4 matrix,
      Material material,
      int layer,
      [UnityEngine.Internal.DefaultValue("null")] Camera camera,
      [UnityEngine.Internal.DefaultValue("0")] int submeshIndex,
      [UnityEngine.Internal.DefaultValue("null")] MaterialPropertyBlock properties,
      [UnityEngine.Internal.DefaultValue("true")] bool castShadows,
      [UnityEngine.Internal.DefaultValue("true")] bool receiveShadows,
      [UnityEngine.Internal.DefaultValue("true")] bool useLightProbes)
    {
      Graphics.DrawMesh(mesh, matrix, material, layer, camera, submeshIndex, properties, castShadows ? ShadowCastingMode.On : ShadowCastingMode.Off, receiveShadows, (Transform) null, useLightProbes ? LightProbeUsage.BlendProbes : LightProbeUsage.Off, (LightProbeProxyVolume) null);
    }

    /// <summary>
    ///   <para>Draw a mesh.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="position">Position of the mesh.</param>
    /// <param name="rotation">Rotation of the mesh.</param>
    /// <param name="matrix">Transformation matrix of the mesh (combines position, rotation and other transformations).</param>
    /// <param name="material">Material to use.</param>
    /// <param name="layer"> the mesh is drawn on.</param>
    /// <param name="camera">If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This applies only to meshes that are composed of several materials.</param>
    /// <param name="properties">Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock.</param>
    /// <param name="castShadows">Determines whether the mesh can cast shadows.</param>
    /// <param name="receiveShadows">Determines whether the mesh can receive shadows.</param>
    /// <param name="useLightProbes">Should the mesh use light probes?</param>
    /// <param name="probeAnchor">If used, the mesh will use this Transform's position to sample light probes and find the matching reflection probe.</param>
    /// <param name="lightProbeUsage">LightProbeUsage for the mesh.</param>
    /// <param name="lightProbeProxyVolume"></param>
    public static void DrawMesh(
      Mesh mesh,
      Matrix4x4 matrix,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      Transform probeAnchor,
      LightProbeUsage lightProbeUsage,
      [UnityEngine.Internal.DefaultValue("null")] LightProbeProxyVolume lightProbeProxyVolume)
    {
      if (lightProbeUsage == LightProbeUsage.UseProxyVolume && (Object) lightProbeProxyVolume == (Object) null)
        throw new ArgumentException("Argument lightProbeProxyVolume must not be null if lightProbeUsage is set to UseProxyVolume.", nameof (lightProbeProxyVolume));
      Graphics.Internal_DrawMesh(mesh, submeshIndex, matrix, material, layer, camera, properties, castShadows, receiveShadows, probeAnchor, lightProbeUsage, lightProbeProxyVolume);
    }

    /// <summary>
    ///   <para>Draws the same mesh multiple times using GPU instancing.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This applies only to meshes that are composed of several materials.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="matrices">The array of object transformation matrices.</param>
    /// <param name="count">The number of instances to be drawn.</param>
    /// <param name="properties">Additional material properties to apply. See MaterialPropertyBlock.</param>
    /// <param name="castShadows">Determines whether the Meshes should cast shadows.</param>
    /// <param name="receiveShadows">Determines whether the Meshes should receive shadows.</param>
    /// <param name="layer"> to use.</param>
    /// <param name="camera">If null (default), the mesh will be drawn in all cameras. Otherwise it will be drawn in the given Camera only.</param>
    /// <param name="lightProbeUsage">LightProbeUsage for the instances.</param>
    /// <param name="lightProbeProxyVolume"></param>
    public static void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      Matrix4x4[] matrices,
      [UnityEngine.Internal.DefaultValue("matrices.Length")] int count,
      [UnityEngine.Internal.DefaultValue("null")] MaterialPropertyBlock properties,
      [UnityEngine.Internal.DefaultValue("ShadowCastingMode.On")] ShadowCastingMode castShadows,
      [UnityEngine.Internal.DefaultValue("true")] bool receiveShadows,
      [UnityEngine.Internal.DefaultValue("0")] int layer,
      [UnityEngine.Internal.DefaultValue("null")] Camera camera,
      [UnityEngine.Internal.DefaultValue("LightProbeUsage.BlendProbes")] LightProbeUsage lightProbeUsage,
      [UnityEngine.Internal.DefaultValue("null")] LightProbeProxyVolume lightProbeProxyVolume)
    {
      if (!SystemInfo.supportsInstancing)
        throw new InvalidOperationException("Instancing is not supported.");
      if ((Object) mesh == (Object) null)
        throw new ArgumentNullException(nameof (mesh));
      if (submeshIndex < 0 || submeshIndex >= mesh.subMeshCount)
        throw new ArgumentOutOfRangeException(nameof (submeshIndex), "submeshIndex out of range.");
      if ((Object) material == (Object) null)
        throw new ArgumentNullException(nameof (material));
      if (!material.enableInstancing)
        throw new InvalidOperationException("Material needs to enable instancing for use with DrawMeshInstanced.");
      if (matrices == null)
        throw new ArgumentNullException(nameof (matrices));
      if (count < 0 || count > Mathf.Min(Graphics.kMaxDrawMeshInstanceCount, matrices.Length))
        throw new ArgumentOutOfRangeException(nameof (count), string.Format("Count must be in the range of 0 to {0}.", (object) Mathf.Min(Graphics.kMaxDrawMeshInstanceCount, matrices.Length)));
      if (lightProbeUsage == LightProbeUsage.UseProxyVolume && (Object) lightProbeProxyVolume == (Object) null)
        throw new ArgumentException("Argument lightProbeProxyVolume must not be null if lightProbeUsage is set to UseProxyVolume.", nameof (lightProbeProxyVolume));
      if (count <= 0)
        return;
      Graphics.Internal_DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, lightProbeProxyVolume);
    }

    public static void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      List<Matrix4x4> matrices,
      [UnityEngine.Internal.DefaultValue("null")] MaterialPropertyBlock properties,
      [UnityEngine.Internal.DefaultValue("ShadowCastingMode.On")] ShadowCastingMode castShadows,
      [UnityEngine.Internal.DefaultValue("true")] bool receiveShadows,
      [UnityEngine.Internal.DefaultValue("0")] int layer,
      [UnityEngine.Internal.DefaultValue("null")] Camera camera,
      [UnityEngine.Internal.DefaultValue("LightProbeUsage.BlendProbes")] LightProbeUsage lightProbeUsage,
      [UnityEngine.Internal.DefaultValue("null")] LightProbeProxyVolume lightProbeProxyVolume)
    {
      if (matrices == null)
        throw new ArgumentNullException(nameof (matrices));
      Graphics.DrawMeshInstanced(mesh, submeshIndex, material, NoAllocHelpers.ExtractArrayFromListT<Matrix4x4>(matrices), matrices.Count, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, lightProbeProxyVolume);
    }

    /// <summary>
    ///         <para>Draws the same mesh multiple times using GPU instancing.
    /// This is similar to Graphics.DrawMeshInstancedIndirect, except that when the instance count is known from script, it can be supplied directly using this method, rather than via a ComputeBuffer.</para>
    ///       </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This applies only to meshes that are composed of several materials.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="bounds">The bounding volume surrounding the instances you intend to draw.</param>
    /// <param name="count">The number of instances to be drawn.</param>
    /// <param name="properties">Additional material properties to apply. See MaterialPropertyBlock.</param>
    /// <param name="castShadows">Determines whether the Meshes should cast shadows.</param>
    /// <param name="receiveShadows">Determines whether the Meshes should receive shadows.</param>
    /// <param name="layer"> to use.</param>
    /// <param name="camera">If null (default), the mesh will be drawn in all cameras. Otherwise it will be drawn in the given Camera only.</param>
    /// <param name="lightProbeUsage">LightProbeUsage for the instances.</param>
    /// <param name="lightProbeProxyVolume"></param>
    public static void DrawMeshInstancedProcedural(
      Mesh mesh,
      int submeshIndex,
      Material material,
      Bounds bounds,
      int count,
      MaterialPropertyBlock properties = null,
      ShadowCastingMode castShadows = ShadowCastingMode.On,
      bool receiveShadows = true,
      int layer = 0,
      Camera camera = null,
      LightProbeUsage lightProbeUsage = LightProbeUsage.BlendProbes,
      LightProbeProxyVolume lightProbeProxyVolume = null)
    {
      if (!SystemInfo.supportsInstancing)
        throw new InvalidOperationException("Instancing is not supported.");
      if ((Object) mesh == (Object) null)
        throw new ArgumentNullException(nameof (mesh));
      if (submeshIndex < 0 || submeshIndex >= mesh.subMeshCount)
        throw new ArgumentOutOfRangeException(nameof (submeshIndex), "submeshIndex out of range.");
      if ((Object) material == (Object) null)
        throw new ArgumentNullException(nameof (material));
      if (count <= 0)
        throw new ArgumentOutOfRangeException(nameof (count));
      if (lightProbeUsage == LightProbeUsage.UseProxyVolume && (Object) lightProbeProxyVolume == (Object) null)
        throw new ArgumentException("Argument lightProbeProxyVolume must not be null if lightProbeUsage is set to UseProxyVolume.", nameof (lightProbeProxyVolume));
      if (count <= 0)
        return;
      Graphics.Internal_DrawMeshInstancedProcedural(mesh, submeshIndex, material, bounds, count, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, lightProbeProxyVolume);
    }

    /// <summary>
    ///   <para>Draws the same mesh multiple times using GPU instancing.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This applies only to meshes that are composed of several materials.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="bounds">The bounding volume surrounding the instances you intend to draw.</param>
    /// <param name="bufferWithArgs">The GPU buffer containing the arguments for how many instances of this mesh to draw.</param>
    /// <param name="argsOffset">The byte offset into the buffer, where the draw arguments start.</param>
    /// <param name="properties">Additional material properties to apply. See MaterialPropertyBlock.</param>
    /// <param name="castShadows">Determines whether the mesh can cast shadows.</param>
    /// <param name="receiveShadows">Determines whether the mesh can receive shadows.</param>
    /// <param name="layer"> to use.</param>
    /// <param name="camera">If null (default), the mesh will be drawn in all cameras. Otherwise it will be drawn in the given Camera only.</param>
    /// <param name="lightProbeUsage">LightProbeUsage for the instances.</param>
    /// <param name="lightProbeProxyVolume"></param>
    public static void DrawMeshInstancedIndirect(
      Mesh mesh,
      int submeshIndex,
      Material material,
      Bounds bounds,
      ComputeBuffer bufferWithArgs,
      [UnityEngine.Internal.DefaultValue("0")] int argsOffset,
      [UnityEngine.Internal.DefaultValue("null")] MaterialPropertyBlock properties,
      [UnityEngine.Internal.DefaultValue("ShadowCastingMode.On")] ShadowCastingMode castShadows,
      [UnityEngine.Internal.DefaultValue("true")] bool receiveShadows,
      [UnityEngine.Internal.DefaultValue("0")] int layer,
      [UnityEngine.Internal.DefaultValue("null")] Camera camera,
      [UnityEngine.Internal.DefaultValue("LightProbeUsage.BlendProbes")] LightProbeUsage lightProbeUsage,
      [UnityEngine.Internal.DefaultValue("null")] LightProbeProxyVolume lightProbeProxyVolume)
    {
      if (!SystemInfo.supportsInstancing)
        throw new InvalidOperationException("Instancing is not supported.");
      if ((Object) mesh == (Object) null)
        throw new ArgumentNullException(nameof (mesh));
      if (submeshIndex < 0 || submeshIndex >= mesh.subMeshCount)
        throw new ArgumentOutOfRangeException(nameof (submeshIndex), "submeshIndex out of range.");
      if ((Object) material == (Object) null)
        throw new ArgumentNullException(nameof (material));
      if (bufferWithArgs == null)
        throw new ArgumentNullException(nameof (bufferWithArgs));
      if (lightProbeUsage == LightProbeUsage.UseProxyVolume && (Object) lightProbeProxyVolume == (Object) null)
        throw new ArgumentException("Argument lightProbeProxyVolume must not be null if lightProbeUsage is set to UseProxyVolume.", nameof (lightProbeProxyVolume));
      Graphics.Internal_DrawMeshInstancedIndirect(mesh, submeshIndex, material, bounds, bufferWithArgs, argsOffset, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, lightProbeProxyVolume);
    }

    /// <summary>
    ///   <para>Draws the same mesh multiple times using GPU instancing.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This applies only to meshes that are composed of several materials.</param>
    /// <param name="material">Material to use.</param>
    /// <param name="bounds">The bounding volume surrounding the instances you intend to draw.</param>
    /// <param name="bufferWithArgs">The GPU buffer containing the arguments for how many instances of this mesh to draw.</param>
    /// <param name="argsOffset">The byte offset into the buffer, where the draw arguments start.</param>
    /// <param name="properties">Additional material properties to apply. See MaterialPropertyBlock.</param>
    /// <param name="castShadows">Determines whether the mesh can cast shadows.</param>
    /// <param name="receiveShadows">Determines whether the mesh can receive shadows.</param>
    /// <param name="layer"> to use.</param>
    /// <param name="camera">If null (default), the mesh will be drawn in all cameras. Otherwise it will be drawn in the given Camera only.</param>
    /// <param name="lightProbeUsage">LightProbeUsage for the instances.</param>
    /// <param name="lightProbeProxyVolume"></param>
    public static void DrawMeshInstancedIndirect(
      Mesh mesh,
      int submeshIndex,
      Material material,
      Bounds bounds,
      GraphicsBuffer bufferWithArgs,
      [UnityEngine.Internal.DefaultValue("0")] int argsOffset,
      [UnityEngine.Internal.DefaultValue("null")] MaterialPropertyBlock properties,
      [UnityEngine.Internal.DefaultValue("ShadowCastingMode.On")] ShadowCastingMode castShadows,
      [UnityEngine.Internal.DefaultValue("true")] bool receiveShadows,
      [UnityEngine.Internal.DefaultValue("0")] int layer,
      [UnityEngine.Internal.DefaultValue("null")] Camera camera,
      [UnityEngine.Internal.DefaultValue("LightProbeUsage.BlendProbes")] LightProbeUsage lightProbeUsage,
      [UnityEngine.Internal.DefaultValue("null")] LightProbeProxyVolume lightProbeProxyVolume)
    {
      if (!SystemInfo.supportsInstancing)
        throw new InvalidOperationException("Instancing is not supported.");
      if ((Object) mesh == (Object) null)
        throw new ArgumentNullException(nameof (mesh));
      if (submeshIndex < 0 || submeshIndex >= mesh.subMeshCount)
        throw new ArgumentOutOfRangeException(nameof (submeshIndex), "submeshIndex out of range.");
      if ((Object) material == (Object) null)
        throw new ArgumentNullException(nameof (material));
      if (bufferWithArgs == null)
        throw new ArgumentNullException(nameof (bufferWithArgs));
      if (lightProbeUsage == LightProbeUsage.UseProxyVolume && (Object) lightProbeProxyVolume == (Object) null)
        throw new ArgumentException("Argument lightProbeProxyVolume must not be null if lightProbeUsage is set to UseProxyVolume.", nameof (lightProbeProxyVolume));
      Graphics.Internal_DrawMeshInstancedIndirectGraphicsBuffer(mesh, submeshIndex, material, bounds, bufferWithArgs, argsOffset, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, lightProbeProxyVolume);
    }

    /// <summary>
    ///   <para>Draws procedural geometry on the GPU.</para>
    /// </summary>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="vertexCount">Vertex count to render.</param>
    /// <param name="instanceCount">Instance count to render.</param>
    public static void DrawProceduralNow(MeshTopology topology, int vertexCount, int instanceCount = 1)
    {
      Graphics.Internal_DrawProceduralNow(topology, vertexCount, instanceCount);
    }

    /// <summary>
    ///   <para>Draws procedural geometry on the GPU.</para>
    /// </summary>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="indexCount">Index count to render.</param>
    /// <param name="instanceCount">Instance count to render.</param>
    /// <param name="indexBuffer">Index buffer used to submit vertices to the GPU.</param>
    public static void DrawProceduralNow(
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      int indexCount,
      int instanceCount = 1)
    {
      if (indexBuffer == null)
        throw new ArgumentNullException(nameof (indexBuffer));
      Graphics.Internal_DrawProceduralIndexedNow(topology, indexBuffer, indexCount, instanceCount);
    }

    /// <summary>
    ///   <para>Draws procedural geometry on the GPU.</para>
    /// </summary>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    public static void DrawProceduralIndirectNow(
      MeshTopology topology,
      ComputeBuffer bufferWithArgs,
      int argsOffset = 0)
    {
      if (bufferWithArgs == null)
        throw new ArgumentNullException(nameof (bufferWithArgs));
      Graphics.Internal_DrawProceduralIndirectNow(topology, bufferWithArgs, argsOffset);
    }

    /// <summary>
    ///   <para>Draws procedural geometry on the GPU.</para>
    /// </summary>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="indexBuffer">Index buffer used to submit vertices to the GPU.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    public static void DrawProceduralIndirectNow(
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      ComputeBuffer bufferWithArgs,
      int argsOffset = 0)
    {
      if (indexBuffer == null)
        throw new ArgumentNullException(nameof (indexBuffer));
      if (bufferWithArgs == null)
        throw new ArgumentNullException(nameof (bufferWithArgs));
      Graphics.Internal_DrawProceduralIndexedIndirectNow(topology, indexBuffer, bufferWithArgs, argsOffset);
    }

    /// <summary>
    ///   <para>Draws procedural geometry on the GPU.</para>
    /// </summary>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    public static void DrawProceduralIndirectNow(
      MeshTopology topology,
      GraphicsBuffer bufferWithArgs,
      int argsOffset = 0)
    {
      if (bufferWithArgs == null)
        throw new ArgumentNullException(nameof (bufferWithArgs));
      Graphics.Internal_DrawProceduralIndirectNowGraphicsBuffer(topology, bufferWithArgs, argsOffset);
    }

    /// <summary>
    ///   <para>Draws procedural geometry on the GPU.</para>
    /// </summary>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="indexBuffer">Index buffer used to submit vertices to the GPU.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    public static void DrawProceduralIndirectNow(
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      GraphicsBuffer bufferWithArgs,
      int argsOffset = 0)
    {
      if (indexBuffer == null)
        throw new ArgumentNullException(nameof (indexBuffer));
      if (bufferWithArgs == null)
        throw new ArgumentNullException(nameof (bufferWithArgs));
      Graphics.Internal_DrawProceduralIndexedIndirectNowGraphicsBuffer(topology, indexBuffer, bufferWithArgs, argsOffset);
    }

    /// <summary>
    ///   <para>Draws procedural geometry on the GPU.</para>
    /// </summary>
    /// <param name="material">Material to use.</param>
    /// <param name="bounds">The bounding volume surrounding the instances you intend to draw.</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="vertexCount">Vertex count to render.</param>
    /// <param name="instanceCount">Instance count to render.</param>
    /// <param name="camera">If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only.</param>
    /// <param name="properties">Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock.</param>
    /// <param name="castShadows">Determines whether the mesh can cast shadows.</param>
    /// <param name="receiveShadows">Determines whether the mesh can receive shadows.</param>
    /// <param name="layer"> to use.</param>
    public static void DrawProcedural(
      Material material,
      Bounds bounds,
      MeshTopology topology,
      int vertexCount,
      int instanceCount = 1,
      Camera camera = null,
      MaterialPropertyBlock properties = null,
      ShadowCastingMode castShadows = ShadowCastingMode.On,
      bool receiveShadows = true,
      int layer = 0)
    {
      Graphics.Internal_DrawProcedural(material, bounds, topology, vertexCount, instanceCount, camera, properties, castShadows, receiveShadows, layer);
    }

    /// <summary>
    ///   <para>Draws procedural geometry on the GPU, with an index buffer.</para>
    /// </summary>
    /// <param name="material">Material to use.</param>
    /// <param name="bounds">The bounding volume surrounding the instances you intend to draw.</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="indexBuffer">Index buffer used to submit vertices to the GPU.</param>
    /// <param name="instanceCount">Instance count to render.</param>
    /// <param name="indexCount">Index count to render.</param>
    /// <param name="camera">If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only.</param>
    /// <param name="properties">Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock.</param>
    /// <param name="castShadows">Determines whether the mesh can cast shadows.</param>
    /// <param name="receiveShadows">Determines whether the mesh can receive shadows.</param>
    /// <param name="layer"> to use.</param>
    public static void DrawProcedural(
      Material material,
      Bounds bounds,
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      int indexCount,
      int instanceCount = 1,
      Camera camera = null,
      MaterialPropertyBlock properties = null,
      ShadowCastingMode castShadows = ShadowCastingMode.On,
      bool receiveShadows = true,
      int layer = 0)
    {
      if (indexBuffer == null)
        throw new ArgumentNullException(nameof (indexBuffer));
      Graphics.Internal_DrawProceduralIndexed(material, bounds, topology, indexBuffer, indexCount, instanceCount, camera, properties, castShadows, receiveShadows, layer);
    }

    /// <summary>
    ///   <para>Draws procedural geometry on the GPU.</para>
    /// </summary>
    /// <param name="material">Material to use.</param>
    /// <param name="bounds">The bounding volume surrounding the instances you intend to draw.</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="camera">If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    /// <param name="properties">Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock.</param>
    /// <param name="castShadows">Determines whether the mesh can cast shadows.</param>
    /// <param name="receiveShadows">Determines whether the mesh can receive shadows.</param>
    /// <param name="layer"> to use.</param>
    public static void DrawProceduralIndirect(
      Material material,
      Bounds bounds,
      MeshTopology topology,
      ComputeBuffer bufferWithArgs,
      int argsOffset = 0,
      Camera camera = null,
      MaterialPropertyBlock properties = null,
      ShadowCastingMode castShadows = ShadowCastingMode.On,
      bool receiveShadows = true,
      int layer = 0)
    {
      if (bufferWithArgs == null)
        throw new ArgumentNullException(nameof (bufferWithArgs));
      Graphics.Internal_DrawProceduralIndirect(material, bounds, topology, bufferWithArgs, argsOffset, camera, properties, castShadows, receiveShadows, layer);
    }

    /// <summary>
    ///   <para>Draws procedural geometry on the GPU.</para>
    /// </summary>
    /// <param name="material">Material to use.</param>
    /// <param name="bounds">The bounding volume surrounding the instances you intend to draw.</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="camera">If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    /// <param name="properties">Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock.</param>
    /// <param name="castShadows">Determines whether the mesh can cast shadows.</param>
    /// <param name="receiveShadows">Determines whether the mesh can receive shadows.</param>
    /// <param name="layer"> to use.</param>
    public static void DrawProceduralIndirect(
      Material material,
      Bounds bounds,
      MeshTopology topology,
      GraphicsBuffer bufferWithArgs,
      int argsOffset = 0,
      Camera camera = null,
      MaterialPropertyBlock properties = null,
      ShadowCastingMode castShadows = ShadowCastingMode.On,
      bool receiveShadows = true,
      int layer = 0)
    {
      if (bufferWithArgs == null)
        throw new ArgumentNullException(nameof (bufferWithArgs));
      Graphics.Internal_DrawProceduralIndirectGraphicsBuffer(material, bounds, topology, bufferWithArgs, argsOffset, camera, properties, castShadows, receiveShadows, layer);
    }

    /// <summary>
    ///   <para>Draws procedural geometry on the GPU.</para>
    /// </summary>
    /// <param name="material">Material to use.</param>
    /// <param name="bounds">The bounding volume surrounding the instances you intend to draw.</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="indexBuffer">Index buffer used to submit vertices to the GPU.</param>
    /// <param name="camera">If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    /// <param name="properties">Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock.</param>
    /// <param name="castShadows">Determines whether the mesh can cast shadows.</param>
    /// <param name="receiveShadows">Determines whether the mesh can receive shadows.</param>
    /// <param name="layer"> to use.</param>
    public static void DrawProceduralIndirect(
      Material material,
      Bounds bounds,
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      ComputeBuffer bufferWithArgs,
      int argsOffset = 0,
      Camera camera = null,
      MaterialPropertyBlock properties = null,
      ShadowCastingMode castShadows = ShadowCastingMode.On,
      bool receiveShadows = true,
      int layer = 0)
    {
      if (indexBuffer == null)
        throw new ArgumentNullException(nameof (indexBuffer));
      if (bufferWithArgs == null)
        throw new ArgumentNullException(nameof (bufferWithArgs));
      Graphics.Internal_DrawProceduralIndexedIndirect(material, bounds, topology, indexBuffer, bufferWithArgs, argsOffset, camera, properties, castShadows, receiveShadows, layer);
    }

    /// <summary>
    ///   <para>Draws procedural geometry on the GPU.</para>
    /// </summary>
    /// <param name="material">Material to use.</param>
    /// <param name="bounds">The bounding volume surrounding the instances you intend to draw.</param>
    /// <param name="topology">Topology of the procedural geometry.</param>
    /// <param name="indexBuffer">Index buffer used to submit vertices to the GPU.</param>
    /// <param name="camera">If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only.</param>
    /// <param name="bufferWithArgs">Buffer with draw arguments.</param>
    /// <param name="argsOffset">Byte offset where in the buffer the draw arguments are.</param>
    /// <param name="properties">Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock.</param>
    /// <param name="castShadows">Determines whether the mesh can cast shadows.</param>
    /// <param name="receiveShadows">Determines whether the mesh can receive shadows.</param>
    /// <param name="layer"> to use.</param>
    public static void DrawProceduralIndirect(
      Material material,
      Bounds bounds,
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      GraphicsBuffer bufferWithArgs,
      int argsOffset = 0,
      Camera camera = null,
      MaterialPropertyBlock properties = null,
      ShadowCastingMode castShadows = ShadowCastingMode.On,
      bool receiveShadows = true,
      int layer = 0)
    {
      if (indexBuffer == null)
        throw new ArgumentNullException(nameof (indexBuffer));
      if (bufferWithArgs == null)
        throw new ArgumentNullException(nameof (bufferWithArgs));
      Graphics.Internal_DrawProceduralIndexedIndirectGraphicsBuffer(material, bounds, topology, indexBuffer, bufferWithArgs, argsOffset, camera, properties, castShadows, receiveShadows, layer);
    }

    /// <summary>
    ///   <para>Uses a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture.</param>
    /// <param name="dest">The destination RenderTexture.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public static void Blit(Texture source, RenderTexture dest) => Graphics.Blit2(source, dest);

    /// <summary>
    ///   <para>Uses a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture.</param>
    /// <param name="dest">The destination RenderTexture.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public static void Blit(
      Texture source,
      RenderTexture dest,
      int sourceDepthSlice,
      int destDepthSlice)
    {
      Graphics.Blit3(source, dest, sourceDepthSlice, destDepthSlice);
    }

    /// <summary>
    ///   <para>Uses a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture.</param>
    /// <param name="dest">The destination RenderTexture.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public static void Blit(Texture source, RenderTexture dest, Vector2 scale, Vector2 offset)
    {
      Graphics.Blit4(source, dest, scale, offset);
    }

    /// <summary>
    ///   <para>Uses a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture.</param>
    /// <param name="dest">The destination RenderTexture.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public static void Blit(
      Texture source,
      RenderTexture dest,
      Vector2 scale,
      Vector2 offset,
      int sourceDepthSlice,
      int destDepthSlice)
    {
      Graphics.Blit5(source, dest, scale, offset, sourceDepthSlice, destDepthSlice);
    }

    /// <summary>
    ///   <para>Uses a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture.</param>
    /// <param name="dest">The destination RenderTexture.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public static void Blit(Texture source, RenderTexture dest, Material mat, [UnityEngine.Internal.DefaultValue("-1")] int pass)
    {
      Graphics.Internal_BlitMaterial5(source, dest, mat, pass, true);
    }

    public static void Blit(
      Texture source,
      RenderTexture dest,
      Material mat,
      int pass,
      int destDepthSlice)
    {
      Graphics.Internal_BlitMaterial6(source, dest, mat, pass, true, destDepthSlice);
    }

    public static void Blit(Texture source, RenderTexture dest, Material mat)
    {
      Graphics.Blit(source, dest, mat, -1);
    }

    /// <summary>
    ///   <para>Uses a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture.</param>
    /// <param name="dest">The destination RenderTexture.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public static void Blit(Texture source, Material mat, [UnityEngine.Internal.DefaultValue("-1")] int pass)
    {
      Graphics.Internal_BlitMaterial5(source, (RenderTexture) null, mat, pass, false);
    }

    /// <summary>
    ///   <para>Uses a shader to copy the pixel data from a texture into a render texture.</para>
    /// </summary>
    /// <param name="source">The source texture.</param>
    /// <param name="dest">The destination RenderTexture.</param>
    /// <param name="mat">The material to use. If you don't provide mat, Unity uses a default material.</param>
    /// <param name="pass">If the value is -1, Unity draws all the passes in mat. Otherwise, Unity draws only the pass you set pass to. The default value is -1.</param>
    /// <param name="scale">The scale to apply.</param>
    /// <param name="offset">The offset to apply.</param>
    /// <param name="sourceDepthSlice">The element in the source texture to copy from, for example the texture in a texture array. You can't use sourceDepthSlice to specify a face in a Cubemap.</param>
    /// <param name="destDepthSlice">The element in the destination texture to copy from, for example the texture in a texture array. You can't use destDepthSlice to specify a face in a Cubemap.</param>
    public static void Blit(Texture source, Material mat, int pass, int destDepthSlice)
    {
      Graphics.Internal_BlitMaterial6(source, (RenderTexture) null, mat, pass, false, destDepthSlice);
    }

    public static void Blit(Texture source, Material mat) => Graphics.Blit(source, mat, -1);

    /// <summary>
    ///   <para>Copies source texture into destination, for multi-tap shader.</para>
    /// </summary>
    /// <param name="source">Source texture.</param>
    /// <param name="dest">Destination RenderTexture, or null to blit directly to screen.</param>
    /// <param name="mat">Material to use for copying. Material's shader should do some post-processing effect.</param>
    /// <param name="offsets">Variable number of filtering offsets. Offsets are given in pixels.</param>
    /// <param name="destDepthSlice">The texture array destination slice to blit to.</param>
    public static void BlitMultiTap(
      Texture source,
      RenderTexture dest,
      Material mat,
      params Vector2[] offsets)
    {
      if (offsets.Length == 0)
        throw new ArgumentException("empty offsets list passed.", nameof (offsets));
      Graphics.Internal_BlitMultiTap4(source, dest, mat, offsets);
    }

    /// <summary>
    ///   <para>Copies source texture into destination, for multi-tap shader.</para>
    /// </summary>
    /// <param name="source">Source texture.</param>
    /// <param name="dest">Destination RenderTexture, or null to blit directly to screen.</param>
    /// <param name="mat">Material to use for copying. Material's shader should do some post-processing effect.</param>
    /// <param name="offsets">Variable number of filtering offsets. Offsets are given in pixels.</param>
    /// <param name="destDepthSlice">The texture array destination slice to blit to.</param>
    public static void BlitMultiTap(
      Texture source,
      RenderTexture dest,
      Material mat,
      int destDepthSlice,
      params Vector2[] offsets)
    {
      if (offsets.Length == 0)
        throw new ArgumentException("empty offsets list passed.", nameof (offsets));
      Graphics.Internal_BlitMultiTap5(source, dest, mat, offsets, destDepthSlice);
    }

    [Obsolete("Method DrawMesh has been deprecated. Use Graphics.DrawMeshNow instead (UnityUpgradable) -> DrawMeshNow(*)", true)]
    [ExcludeFromDocs]
    [EditorBrowsable(EditorBrowsableState.Never)]
    public static void DrawMesh(Mesh mesh, Vector3 position, Quaternion rotation)
    {
    }

    [Obsolete("Method DrawMesh has been deprecated. Use Graphics.DrawMeshNow instead (UnityUpgradable) -> DrawMeshNow(*)", true)]
    [ExcludeFromDocs]
    [EditorBrowsable(EditorBrowsableState.Never)]
    public static void DrawMesh(
      Mesh mesh,
      Vector3 position,
      Quaternion rotation,
      int materialIndex)
    {
    }

    [ExcludeFromDocs]
    [EditorBrowsable(EditorBrowsableState.Never)]
    [Obsolete("Method DrawMesh has been deprecated. Use Graphics.DrawMeshNow instead (UnityUpgradable) -> DrawMeshNow(*)", true)]
    public static void DrawMesh(Mesh mesh, Matrix4x4 matrix)
    {
    }

    [EditorBrowsable(EditorBrowsableState.Never)]
    [ExcludeFromDocs]
    [Obsolete("Method DrawMesh has been deprecated. Use Graphics.DrawMeshNow instead (UnityUpgradable) -> DrawMeshNow(*)", true)]
    public static void DrawMesh(Mesh mesh, Matrix4x4 matrix, int materialIndex)
    {
    }

    [ExcludeFromDocs]
    [Obsolete("Method DrawProcedural has been deprecated. Use Graphics.DrawProceduralNow instead. (UnityUpgradable) -> DrawProceduralNow(*)", true)]
    [EditorBrowsable(EditorBrowsableState.Never)]
    public static void DrawProcedural(MeshTopology topology, int vertexCount, int instanceCount = 1)
    {
      Graphics.DrawProceduralNow(topology, vertexCount, instanceCount);
    }

    [EditorBrowsable(EditorBrowsableState.Never)]
    [Obsolete("Method DrawProceduralIndirect has been deprecated. Use Graphics.DrawProceduralIndirectNow instead. (UnityUpgradable) -> DrawProceduralIndirectNow(*)", true)]
    [ExcludeFromDocs]
    public static void DrawProceduralIndirect(
      MeshTopology topology,
      ComputeBuffer bufferWithArgs,
      int argsOffset = 0)
    {
      Graphics.DrawProceduralIndirectNow(topology, bufferWithArgs, argsOffset);
    }

    [EditorBrowsable(EditorBrowsableState.Never)]
    [Obsolete("Property deviceName has been deprecated. Use SystemInfo.graphicsDeviceName instead (UnityUpgradable) -> UnityEngine.SystemInfo.graphicsDeviceName", true)]
    public static string deviceName => SystemInfo.graphicsDeviceName;

    [EditorBrowsable(EditorBrowsableState.Never)]
    [Obsolete("Property deviceVendor has been deprecated. Use SystemInfo.graphicsDeviceVendor instead (UnityUpgradable) -> UnityEngine.SystemInfo.graphicsDeviceVendor", true)]
    public static string deviceVendor => SystemInfo.graphicsDeviceVendor;

    [Obsolete("Property deviceVersion has been deprecated. Use SystemInfo.graphicsDeviceVersion instead (UnityUpgradable) -> UnityEngine.SystemInfo.graphicsDeviceVersion", true)]
    [EditorBrowsable(EditorBrowsableState.Never)]
    public static string deviceVersion => SystemInfo.graphicsDeviceVersion;

    /// <summary>
    ///   <para>This functionality is deprecated, and should no longer be used. Please use Graphics.CreateGraphicsFence.</para>
    /// </summary>
    /// <param name="stage"></param>
    [EditorBrowsable(EditorBrowsableState.Never)]
    [Obsolete("CreateGPUFence has been deprecated. Use CreateGraphicsFence instead (UnityUpgradable) -> CreateAsyncGraphicsFence(*)", true)]
    public static GPUFence CreateGPUFence([UnityEngine.Internal.DefaultValue("UnityEngine.Rendering.SynchronisationStage.PixelProcessing")] SynchronisationStage stage)
    {
      return new GPUFence();
    }

    /// <summary>
    ///   <para>This functionality is deprecated, and should no longer be used. Please use Graphics.WaitOnAsyncGraphicsFence.</para>
    /// </summary>
    /// <param name="fence"></param>
    /// <param name="stage"></param>
    [EditorBrowsable(EditorBrowsableState.Never)]
    [Obsolete("WaitOnGPUFence has been deprecated. Use WaitOnAsyncGraphicsFence instead (UnityUpgradable) -> WaitOnAsyncGraphicsFence(*)", true)]
    public static void WaitOnGPUFence(GPUFence fence, [UnityEngine.Internal.DefaultValue("UnityEngine.Rendering.SynchronisationStage.PixelProcessing")] SynchronisationStage stage)
    {
    }

    [ExcludeFromDocs]
    [EditorBrowsable(EditorBrowsableState.Never)]
    [Obsolete("CreateGPUFence has been deprecated. Use CreateGraphicsFence instead (UnityUpgradable) -> CreateAsyncGraphicsFence(*)", true)]
    public static GPUFence CreateGPUFence() => new GPUFence();

    [EditorBrowsable(EditorBrowsableState.Never)]
    [Obsolete("WaitOnGPUFence has been deprecated. Use WaitOnAsyncGraphicsFence instead (UnityUpgradable) -> WaitOnAsyncGraphicsFence(*)", true)]
    [ExcludeFromDocs]
    public static void WaitOnGPUFence(GPUFence fence)
    {
    }

    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Vector3 position,
      Quaternion rotation,
      Material material,
      int layer)
    {
      Graphics.DrawMesh(mesh, Matrix4x4.TRS(position, rotation, Vector3.one), material, layer, (Camera) null, 0, (MaterialPropertyBlock) null, ShadowCastingMode.On, true, (Transform) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Vector3 position,
      Quaternion rotation,
      Material material,
      int layer,
      Camera camera)
    {
      Graphics.DrawMesh(mesh, Matrix4x4.TRS(position, rotation, Vector3.one), material, layer, camera, 0, (MaterialPropertyBlock) null, ShadowCastingMode.On, true, (Transform) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Vector3 position,
      Quaternion rotation,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex)
    {
      Graphics.DrawMesh(mesh, Matrix4x4.TRS(position, rotation, Vector3.one), material, layer, camera, submeshIndex, (MaterialPropertyBlock) null, ShadowCastingMode.On, true, (Transform) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Vector3 position,
      Quaternion rotation,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex,
      MaterialPropertyBlock properties)
    {
      Graphics.DrawMesh(mesh, Matrix4x4.TRS(position, rotation, Vector3.one), material, layer, camera, submeshIndex, properties, ShadowCastingMode.On, true, (Transform) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Vector3 position,
      Quaternion rotation,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex,
      MaterialPropertyBlock properties,
      bool castShadows)
    {
      Graphics.DrawMesh(mesh, Matrix4x4.TRS(position, rotation, Vector3.one), material, layer, camera, submeshIndex, properties, castShadows ? ShadowCastingMode.On : ShadowCastingMode.Off, true, (Transform) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Vector3 position,
      Quaternion rotation,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex,
      MaterialPropertyBlock properties,
      bool castShadows,
      bool receiveShadows)
    {
      Graphics.DrawMesh(mesh, Matrix4x4.TRS(position, rotation, Vector3.one), material, layer, camera, submeshIndex, properties, castShadows ? ShadowCastingMode.On : ShadowCastingMode.Off, receiveShadows, (Transform) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Vector3 position,
      Quaternion rotation,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows)
    {
      Graphics.DrawMesh(mesh, Matrix4x4.TRS(position, rotation, Vector3.one), material, layer, camera, submeshIndex, properties, castShadows, true, (Transform) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Vector3 position,
      Quaternion rotation,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows)
    {
      Graphics.DrawMesh(mesh, Matrix4x4.TRS(position, rotation, Vector3.one), material, layer, camera, submeshIndex, properties, castShadows, receiveShadows, (Transform) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Vector3 position,
      Quaternion rotation,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      Transform probeAnchor)
    {
      Graphics.DrawMesh(mesh, Matrix4x4.TRS(position, rotation, Vector3.one), material, layer, camera, submeshIndex, properties, castShadows, receiveShadows, probeAnchor, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMesh(Mesh mesh, Matrix4x4 matrix, Material material, int layer)
    {
      Graphics.DrawMesh(mesh, matrix, material, layer, (Camera) null, 0, (MaterialPropertyBlock) null, ShadowCastingMode.On, true, (Transform) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Matrix4x4 matrix,
      Material material,
      int layer,
      Camera camera)
    {
      Graphics.DrawMesh(mesh, matrix, material, layer, camera, 0, (MaterialPropertyBlock) null, ShadowCastingMode.On, true, (Transform) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Matrix4x4 matrix,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex)
    {
      Graphics.DrawMesh(mesh, matrix, material, layer, camera, submeshIndex, (MaterialPropertyBlock) null, ShadowCastingMode.On, true, (Transform) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Matrix4x4 matrix,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex,
      MaterialPropertyBlock properties)
    {
      Graphics.DrawMesh(mesh, matrix, material, layer, camera, submeshIndex, properties, ShadowCastingMode.On, true, (Transform) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Matrix4x4 matrix,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex,
      MaterialPropertyBlock properties,
      bool castShadows)
    {
      Graphics.DrawMesh(mesh, matrix, material, layer, camera, submeshIndex, properties, castShadows ? ShadowCastingMode.On : ShadowCastingMode.Off, true, (Transform) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Matrix4x4 matrix,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex,
      MaterialPropertyBlock properties,
      bool castShadows,
      bool receiveShadows)
    {
      Graphics.DrawMesh(mesh, matrix, material, layer, camera, submeshIndex, properties, castShadows ? ShadowCastingMode.On : ShadowCastingMode.Off, receiveShadows, (Transform) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Matrix4x4 matrix,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows)
    {
      Graphics.DrawMesh(mesh, matrix, material, layer, camera, submeshIndex, properties, castShadows, true, (Transform) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Matrix4x4 matrix,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows)
    {
      Graphics.DrawMesh(mesh, matrix, material, layer, camera, submeshIndex, properties, castShadows, receiveShadows, (Transform) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Matrix4x4 matrix,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      Transform probeAnchor)
    {
      Graphics.DrawMesh(mesh, matrix, material, layer, camera, submeshIndex, properties, castShadows, receiveShadows, probeAnchor, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    /// <summary>
    ///   <para>Draw a mesh.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="position">Position of the mesh.</param>
    /// <param name="rotation">Rotation of the mesh.</param>
    /// <param name="matrix">Transformation matrix of the mesh (combines position, rotation and other transformations).</param>
    /// <param name="material">Material to use.</param>
    /// <param name="layer"> the mesh is drawn on.</param>
    /// <param name="camera">If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This applies only to meshes that are composed of several materials.</param>
    /// <param name="properties">Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock.</param>
    /// <param name="castShadows">Determines whether the mesh can cast shadows.</param>
    /// <param name="receiveShadows">Determines whether the mesh can receive shadows.</param>
    /// <param name="useLightProbes">Should the mesh use light probes?</param>
    /// <param name="probeAnchor">If used, the mesh will use this Transform's position to sample light probes and find the matching reflection probe.</param>
    /// <param name="lightProbeUsage">LightProbeUsage for the mesh.</param>
    /// <param name="lightProbeProxyVolume"></param>
    public static void DrawMesh(
      Mesh mesh,
      Matrix4x4 matrix,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      [UnityEngine.Internal.DefaultValue("true")] bool receiveShadows,
      [UnityEngine.Internal.DefaultValue("null")] Transform probeAnchor,
      [UnityEngine.Internal.DefaultValue("true")] bool useLightProbes)
    {
      Graphics.DrawMesh(mesh, matrix, material, layer, camera, submeshIndex, properties, castShadows, receiveShadows, probeAnchor, useLightProbes ? LightProbeUsage.BlendProbes : LightProbeUsage.Off, (LightProbeProxyVolume) null);
    }

    /// <summary>
    ///   <para>Draw a mesh.</para>
    /// </summary>
    /// <param name="mesh">The Mesh to draw.</param>
    /// <param name="position">Position of the mesh.</param>
    /// <param name="rotation">Rotation of the mesh.</param>
    /// <param name="matrix">Transformation matrix of the mesh (combines position, rotation and other transformations).</param>
    /// <param name="material">Material to use.</param>
    /// <param name="layer"> the mesh is drawn on.</param>
    /// <param name="camera">If null (default), the mesh will be drawn in all cameras. Otherwise it will be rendered in the given Camera only.</param>
    /// <param name="submeshIndex">Which subset of the mesh to draw. This applies only to meshes that are composed of several materials.</param>
    /// <param name="properties">Additional material properties to apply onto material just before this mesh will be drawn. See MaterialPropertyBlock.</param>
    /// <param name="castShadows">Determines whether the mesh can cast shadows.</param>
    /// <param name="receiveShadows">Determines whether the mesh can receive shadows.</param>
    /// <param name="useLightProbes">Should the mesh use light probes?</param>
    /// <param name="probeAnchor">If used, the mesh will use this Transform's position to sample light probes and find the matching reflection probe.</param>
    /// <param name="lightProbeUsage">LightProbeUsage for the mesh.</param>
    /// <param name="lightProbeProxyVolume"></param>
    [ExcludeFromDocs]
    public static void DrawMesh(
      Mesh mesh,
      Matrix4x4 matrix,
      Material material,
      int layer,
      Camera camera,
      int submeshIndex,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      Transform probeAnchor,
      LightProbeUsage lightProbeUsage)
    {
      Graphics.Internal_DrawMesh(mesh, submeshIndex, matrix, material, layer, camera, properties, castShadows, receiveShadows, probeAnchor, lightProbeUsage, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      Matrix4x4[] matrices)
    {
      Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, matrices.Length, (MaterialPropertyBlock) null, ShadowCastingMode.On, true, 0, (Camera) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      Matrix4x4[] matrices,
      int count)
    {
      Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, (MaterialPropertyBlock) null, ShadowCastingMode.On, true, 0, (Camera) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      Matrix4x4[] matrices,
      int count,
      MaterialPropertyBlock properties)
    {
      Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, ShadowCastingMode.On, true, 0, (Camera) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      Matrix4x4[] matrices,
      int count,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows)
    {
      Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, true, 0, (Camera) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      Matrix4x4[] matrices,
      int count,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows)
    {
      Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, receiveShadows, 0, (Camera) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      Matrix4x4[] matrices,
      int count,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer)
    {
      Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, receiveShadows, layer, (Camera) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      Matrix4x4[] matrices,
      int count,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer,
      Camera camera)
    {
      Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, receiveShadows, layer, camera, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      Matrix4x4[] matrices,
      int count,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer,
      Camera camera,
      LightProbeUsage lightProbeUsage)
    {
      Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, count, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      List<Matrix4x4> matrices)
    {
      Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, (MaterialPropertyBlock) null, ShadowCastingMode.On, true, 0, (Camera) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      List<Matrix4x4> matrices,
      MaterialPropertyBlock properties)
    {
      Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, properties, ShadowCastingMode.On, true, 0, (Camera) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      List<Matrix4x4> matrices,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows)
    {
      Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, properties, castShadows, true, 0, (Camera) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      List<Matrix4x4> matrices,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows)
    {
      Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, properties, castShadows, receiveShadows, 0, (Camera) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      List<Matrix4x4> matrices,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer)
    {
      Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, properties, castShadows, receiveShadows, layer, (Camera) null, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      List<Matrix4x4> matrices,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer,
      Camera camera)
    {
      Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, properties, castShadows, receiveShadows, layer, camera, LightProbeUsage.BlendProbes, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMeshInstanced(
      Mesh mesh,
      int submeshIndex,
      Material material,
      List<Matrix4x4> matrices,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer,
      Camera camera,
      LightProbeUsage lightProbeUsage)
    {
      Graphics.DrawMeshInstanced(mesh, submeshIndex, material, matrices, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMeshInstancedIndirect(
      Mesh mesh,
      int submeshIndex,
      Material material,
      Bounds bounds,
      ComputeBuffer bufferWithArgs,
      int argsOffset = 0,
      MaterialPropertyBlock properties = null,
      ShadowCastingMode castShadows = ShadowCastingMode.On,
      bool receiveShadows = true,
      int layer = 0,
      Camera camera = null,
      LightProbeUsage lightProbeUsage = LightProbeUsage.BlendProbes)
    {
      Graphics.DrawMeshInstancedIndirect(mesh, submeshIndex, material, bounds, bufferWithArgs, argsOffset, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, (LightProbeProxyVolume) null);
    }

    [ExcludeFromDocs]
    public static void DrawMeshInstancedIndirect(
      Mesh mesh,
      int submeshIndex,
      Material material,
      Bounds bounds,
      GraphicsBuffer bufferWithArgs,
      int argsOffset = 0,
      MaterialPropertyBlock properties = null,
      ShadowCastingMode castShadows = ShadowCastingMode.On,
      bool receiveShadows = true,
      int layer = 0,
      Camera camera = null,
      LightProbeUsage lightProbeUsage = LightProbeUsage.BlendProbes)
    {
      Graphics.DrawMeshInstancedIndirect(mesh, submeshIndex, material, bounds, bufferWithArgs, argsOffset, properties, castShadows, receiveShadows, layer, camera, lightProbeUsage, (LightProbeProxyVolume) null);
    }

    /// <summary>
    ///   <para>Draw a texture in screen coordinates.</para>
    /// </summary>
    /// <param name="screenRect">Rectangle on the screen to use for the texture. In pixel coordinates with (0,0) in the upper-left corner.</param>
    /// <param name="texture">Texture to draw.</param>
    /// <param name="sourceRect">Region of the texture to use. In normalized coordinates with (0,0) in the bottom-left corner.</param>
    /// <param name="leftBorder">Number of pixels from the left that are not affected by scale.</param>
    /// <param name="rightBorder">Number of pixels from the right that are not affected by scale.</param>
    /// <param name="topBorder">Number of pixels from the top that are not affected by scale.</param>
    /// <param name="bottomBorder">Number of pixels from the bottom that are not affected by scale.</param>
    /// <param name="color">Color that modulates the output. The neutral value is (0.5, 0.5, 0.5, 0.5). Set as vertex color for the shader.</param>
    /// <param name="mat">Custom Material that can be used to draw the texture. If null is passed, a default material with the Internal-GUITexture.shader is used.</param>
    /// <param name="pass">If -1 (default), draws all passes in the material. Otherwise, draws given pass only.</param>
    [ExcludeFromDocs]
    public static void DrawTexture(
      Rect screenRect,
      Texture texture,
      Rect sourceRect,
      int leftBorder,
      int rightBorder,
      int topBorder,
      int bottomBorder,
      Color color,
      Material mat)
    {
      Graphics.DrawTexture(screenRect, texture, sourceRect, leftBorder, rightBorder, topBorder, bottomBorder, color, mat, -1);
    }

    [ExcludeFromDocs]
    public static void DrawTexture(
      Rect screenRect,
      Texture texture,
      Rect sourceRect,
      int leftBorder,
      int rightBorder,
      int topBorder,
      int bottomBorder,
      Color color)
    {
      Graphics.DrawTexture(screenRect, texture, sourceRect, leftBorder, rightBorder, topBorder, bottomBorder, color, (Material) null, -1);
    }

    /// <summary>
    ///   <para>Draw a texture in screen coordinates.</para>
    /// </summary>
    /// <param name="screenRect">Rectangle on the screen to use for the texture. In pixel coordinates with (0,0) in the upper-left corner.</param>
    /// <param name="texture">Texture to draw.</param>
    /// <param name="sourceRect">Region of the texture to use. In normalized coordinates with (0,0) in the bottom-left corner.</param>
    /// <param name="leftBorder">Number of pixels from the left that are not affected by scale.</param>
    /// <param name="rightBorder">Number of pixels from the right that are not affected by scale.</param>
    /// <param name="topBorder">Number of pixels from the top that are not affected by scale.</param>
    /// <param name="bottomBorder">Number of pixels from the bottom that are not affected by scale.</param>
    /// <param name="color">Color that modulates the output. The neutral value is (0.5, 0.5, 0.5, 0.5). Set as vertex color for the shader.</param>
    /// <param name="mat">Custom Material that can be used to draw the texture. If null is passed, a default material with the Internal-GUITexture.shader is used.</param>
    /// <param name="pass">If -1 (default), draws all passes in the material. Otherwise, draws given pass only.</param>
    [ExcludeFromDocs]
    public static void DrawTexture(
      Rect screenRect,
      Texture texture,
      Rect sourceRect,
      int leftBorder,
      int rightBorder,
      int topBorder,
      int bottomBorder,
      Material mat)
    {
      Graphics.DrawTexture(screenRect, texture, sourceRect, leftBorder, rightBorder, topBorder, bottomBorder, mat, -1);
    }

    [ExcludeFromDocs]
    public static void DrawTexture(
      Rect screenRect,
      Texture texture,
      Rect sourceRect,
      int leftBorder,
      int rightBorder,
      int topBorder,
      int bottomBorder)
    {
      Graphics.DrawTexture(screenRect, texture, sourceRect, leftBorder, rightBorder, topBorder, bottomBorder, (Material) null, -1);
    }

    /// <summary>
    ///   <para>Draw a texture in screen coordinates.</para>
    /// </summary>
    /// <param name="screenRect">Rectangle on the screen to use for the texture. In pixel coordinates with (0,0) in the upper-left corner.</param>
    /// <param name="texture">Texture to draw.</param>
    /// <param name="sourceRect">Region of the texture to use. In normalized coordinates with (0,0) in the bottom-left corner.</param>
    /// <param name="leftBorder">Number of pixels from the left that are not affected by scale.</param>
    /// <param name="rightBorder">Number of pixels from the right that are not affected by scale.</param>
    /// <param name="topBorder">Number of pixels from the top that are not affected by scale.</param>
    /// <param name="bottomBorder">Number of pixels from the bottom that are not affected by scale.</param>
    /// <param name="color">Color that modulates the output. The neutral value is (0.5, 0.5, 0.5, 0.5). Set as vertex color for the shader.</param>
    /// <param name="mat">Custom Material that can be used to draw the texture. If null is passed, a default material with the Internal-GUITexture.shader is used.</param>
    /// <param name="pass">If -1 (default), draws all passes in the material. Otherwise, draws given pass only.</param>
    [ExcludeFromDocs]
    public static void DrawTexture(
      Rect screenRect,
      Texture texture,
      int leftBorder,
      int rightBorder,
      int topBorder,
      int bottomBorder,
      Material mat)
    {
      Graphics.DrawTexture(screenRect, texture, leftBorder, rightBorder, topBorder, bottomBorder, mat, -1);
    }

    [ExcludeFromDocs]
    public static void DrawTexture(
      Rect screenRect,
      Texture texture,
      int leftBorder,
      int rightBorder,
      int topBorder,
      int bottomBorder)
    {
      Graphics.DrawTexture(screenRect, texture, leftBorder, rightBorder, topBorder, bottomBorder, (Material) null, -1);
    }

    /// <summary>
    ///   <para>Draw a texture in screen coordinates.</para>
    /// </summary>
    /// <param name="screenRect">Rectangle on the screen to use for the texture. In pixel coordinates with (0,0) in the upper-left corner.</param>
    /// <param name="texture">Texture to draw.</param>
    /// <param name="sourceRect">Region of the texture to use. In normalized coordinates with (0,0) in the bottom-left corner.</param>
    /// <param name="leftBorder">Number of pixels from the left that are not affected by scale.</param>
    /// <param name="rightBorder">Number of pixels from the right that are not affected by scale.</param>
    /// <param name="topBorder">Number of pixels from the top that are not affected by scale.</param>
    /// <param name="bottomBorder">Number of pixels from the bottom that are not affected by scale.</param>
    /// <param name="color">Color that modulates the output. The neutral value is (0.5, 0.5, 0.5, 0.5). Set as vertex color for the shader.</param>
    /// <param name="mat">Custom Material that can be used to draw the texture. If null is passed, a default material with the Internal-GUITexture.shader is used.</param>
    /// <param name="pass">If -1 (default), draws all passes in the material. Otherwise, draws given pass only.</param>
    [ExcludeFromDocs]
    public static void DrawTexture(Rect screenRect, Texture texture, Material mat)
    {
      Graphics.DrawTexture(screenRect, texture, mat, -1);
    }

    [ExcludeFromDocs]
    public static void DrawTexture(Rect screenRect, Texture texture)
    {
      Graphics.DrawTexture(screenRect, texture, (Material) null, -1);
    }

    [ExcludeFromDocs]
    public static void SetRenderTarget(RenderTexture rt)
    {
      Graphics.SetRenderTarget(rt, 0, CubemapFace.Unknown, 0);
    }

    [ExcludeFromDocs]
    public static void SetRenderTarget(RenderTexture rt, int mipLevel)
    {
      Graphics.SetRenderTarget(rt, mipLevel, CubemapFace.Unknown, 0);
    }

    [ExcludeFromDocs]
    public static void SetRenderTarget(RenderTexture rt, int mipLevel, CubemapFace face)
    {
      Graphics.SetRenderTarget(rt, mipLevel, face, 0);
    }

    [ExcludeFromDocs]
    public static void SetRenderTarget(RenderBuffer colorBuffer, RenderBuffer depthBuffer)
    {
      Graphics.SetRenderTarget(colorBuffer, depthBuffer, 0, CubemapFace.Unknown, 0);
    }

    [ExcludeFromDocs]
    public static void SetRenderTarget(
      RenderBuffer colorBuffer,
      RenderBuffer depthBuffer,
      int mipLevel)
    {
      Graphics.SetRenderTarget(colorBuffer, depthBuffer, mipLevel, CubemapFace.Unknown, 0);
    }

    [ExcludeFromDocs]
    public static void SetRenderTarget(
      RenderBuffer colorBuffer,
      RenderBuffer depthBuffer,
      int mipLevel,
      CubemapFace face)
    {
      Graphics.SetRenderTarget(colorBuffer, depthBuffer, mipLevel, face, 0);
    }

    [ExcludeFromDocs]
    public static void SetRandomWriteTarget(int index, ComputeBuffer uav)
    {
      Graphics.SetRandomWriteTarget(index, uav, false);
    }

    [ExcludeFromDocs]
    public static void SetRandomWriteTarget(int index, GraphicsBuffer uav)
    {
      Graphics.SetRandomWriteTarget(index, uav, false);
    }

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void GetActiveColorBuffer_Injected(out RenderBuffer ret);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void GetActiveDepthBuffer_Injected(out RenderBuffer ret);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_SetRTSimple_Injected(
      ref RenderBuffer color,
      ref RenderBuffer depth,
      int mip,
      CubemapFace face,
      int depthSlice);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_SetMRTSimple_Injected(
      RenderBuffer[] color,
      ref RenderBuffer depth,
      int mip,
      CubemapFace face,
      int depthSlice);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_SetMRTFullSetup_Injected(
      RenderBuffer[] color,
      ref RenderBuffer depth,
      int mip,
      CubemapFace face,
      int depthSlice,
      RenderBufferLoadAction[] colorLA,
      RenderBufferStoreAction[] colorSA,
      RenderBufferLoadAction depthLA,
      RenderBufferStoreAction depthSA);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawMeshNow1_Injected(
      Mesh mesh,
      int subsetIndex,
      ref Vector3 position,
      ref Quaternion rotation);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawMeshNow2_Injected(
      Mesh mesh,
      int subsetIndex,
      ref Matrix4x4 matrix);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern unsafe void Internal_RenderMesh_Injected(
      ref RenderParams rparams,
      Mesh mesh,
      int submeshIndex,
      ref Matrix4x4 objectToWorld,
      Matrix4x4* prevObjectToWorld);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_RenderMeshInstanced_Injected(
      ref RenderParams rparams,
      Mesh mesh,
      int submeshIndex,
      IntPtr instanceData,
      ref RenderInstancedDataLayout layout,
      uint instanceCount);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_RenderMeshIndirect_Injected(
      ref RenderParams rparams,
      Mesh mesh,
      GraphicsBuffer commandBuffer,
      int commandCount,
      int startCommand);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_RenderMeshPrimitives_Injected(
      ref RenderParams rparams,
      Mesh mesh,
      int submeshIndex,
      int instanceCount);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_RenderPrimitives_Injected(
      ref RenderParams rparams,
      MeshTopology topology,
      int vertexCount,
      int instanceCount);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_RenderPrimitivesIndexed_Injected(
      ref RenderParams rparams,
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      int indexCount,
      int startIndex,
      int instanceCount);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_RenderPrimitivesIndirect_Injected(
      ref RenderParams rparams,
      MeshTopology topology,
      GraphicsBuffer commandBuffer,
      int commandCount,
      int startCommand);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_RenderPrimitivesIndexedIndirect_Injected(
      ref RenderParams rparams,
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      GraphicsBuffer commandBuffer,
      int commandCount,
      int startCommand);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawMesh_Injected(
      Mesh mesh,
      int submeshIndex,
      ref Matrix4x4 matrix,
      Material material,
      int layer,
      Camera camera,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      Transform probeAnchor,
      LightProbeUsage lightProbeUsage,
      LightProbeProxyVolume lightProbeProxyVolume);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawMeshInstancedProcedural_Injected(
      Mesh mesh,
      int submeshIndex,
      Material material,
      ref Bounds bounds,
      int count,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer,
      Camera camera,
      LightProbeUsage lightProbeUsage,
      LightProbeProxyVolume lightProbeProxyVolume);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawMeshInstancedIndirect_Injected(
      Mesh mesh,
      int submeshIndex,
      Material material,
      ref Bounds bounds,
      ComputeBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer,
      Camera camera,
      LightProbeUsage lightProbeUsage,
      LightProbeProxyVolume lightProbeProxyVolume);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawMeshInstancedIndirectGraphicsBuffer_Injected(
      Mesh mesh,
      int submeshIndex,
      Material material,
      ref Bounds bounds,
      GraphicsBuffer bufferWithArgs,
      int argsOffset,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer,
      Camera camera,
      LightProbeUsage lightProbeUsage,
      LightProbeProxyVolume lightProbeProxyVolume);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawProcedural_Injected(
      Material material,
      ref Bounds bounds,
      MeshTopology topology,
      int vertexCount,
      int instanceCount,
      Camera camera,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawProceduralIndexed_Injected(
      Material material,
      ref Bounds bounds,
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      int indexCount,
      int instanceCount,
      Camera camera,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawProceduralIndirect_Injected(
      Material material,
      ref Bounds bounds,
      MeshTopology topology,
      ComputeBuffer bufferWithArgs,
      int argsOffset,
      Camera camera,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawProceduralIndirectGraphicsBuffer_Injected(
      Material material,
      ref Bounds bounds,
      MeshTopology topology,
      GraphicsBuffer bufferWithArgs,
      int argsOffset,
      Camera camera,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawProceduralIndexedIndirect_Injected(
      Material material,
      ref Bounds bounds,
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      ComputeBuffer bufferWithArgs,
      int argsOffset,
      Camera camera,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Internal_DrawProceduralIndexedIndirectGraphicsBuffer_Injected(
      Material material,
      ref Bounds bounds,
      MeshTopology topology,
      GraphicsBuffer indexBuffer,
      GraphicsBuffer bufferWithArgs,
      int argsOffset,
      Camera camera,
      MaterialPropertyBlock properties,
      ShadowCastingMode castShadows,
      bool receiveShadows,
      int layer);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Blit4_Injected(
      Texture source,
      RenderTexture dest,
      ref Vector2 scale,
      ref Vector2 offset);

    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern void Blit5_Injected(
      Texture source,
      RenderTexture dest,
      ref Vector2 scale,
      ref Vector2 offset,
      int sourceDepthSlice,
      int destDepthSlice);
  }
}
